Return to Snippet

Revision: 37795
at December 17, 2010 06:45 by hced


Updated Code
<!-- Load jQuery from Google's CDN -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<!-- Fall back to local lib if loading from Google's CDN fails -->
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.4.js"%3E%3C/script%3E'))</script>

Revision: 37794
at December 17, 2010 05:28 by hced


Initial Code
<!-- Load jQuery from Google's CDN -->
http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
<!-- Fall back to local lib if loading from Google's CDN fails -->
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.4.js"%3E%3C/script%3E'))</script>

Initial URL
http://code.google.com/intl/en-US/apis/libraries/devguide.html

Initial Description
Proper way of loading libs such as jQuery from Google's CDN. Place these JavaScripts at the bottom for fast page loading. To target different versions, you can be more specific if you want; eg. /1.4/ or even /1.4.4/.

(NOTE: you may either use http:// or https:// depending on your needs. Both will work.)

Initial Title
Proper way of loading jQuery from Google\'s CDN with fallback to local lib if necessary

Initial Tags
http, javascript, js, google, script, jquery, load, api

Initial Language
HTML