PDA

View Full Version : Quick note/suggestion about jQuery integration


ABC123

Sparticuz
10-18-2011, 11:39 AM
jQuery integration has been one of my most highly anticipated features of v11, so it was the first thing I started working on when I loaded alpha 11 yesterday. I went to the settings, turned on Load from Google's CDN, republished all my files and looked in the source of my pages. Lo and behold!
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js (http://msgboard.alphasoftware.com/alphaforum/view-source:http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js)" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js (http://msgboard.alphasoftware.com/alphaforum/view-source:http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js)" type="text/javascript"></script>
<script> if(typeof jQuery != 'undefined') jQuery.noConflict();</script>That's a great start. But on my SSL enabled site, I get an error about my page: "This page has insecure items: Load Anyways?" (Chrome). A trick I learned a few months ago is to drop the http: in front of the URL. This effectively turns your request into the same type as the page your are on. So if you are on a http connection it would use http://etc..... If you are on a https connection, it would use https://etc.....
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js (http://msgboard.alphasoftware.com/alphaforum/view-source:http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js)"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js (http://msgboard.alphasoftware.com/alphaforum/view-source:http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js)"></script>It's called a protocol relative url, and is actually effective for more than just this one case.
SOURCE: http://paulirish.com/2010/the-protocol-relative-url/

Sparticuz
10-19-2011, 09:26 AM
Selwyn fixed in Build 2197_3808 - Oct 19 2011


Web Application - jQuery Libraries - Protocol - If you have specified in the Web Project Properties that jQuery should be loaded from Google or the jQuery web site, the HTML markup that is generated to link the jQuery libraries now no longer includes the protocol (http:) in the link. This prevents browser warnings from appearing if the host page is using the https protocol.