Some web developers know that Google and Microsoft host copies of popular frameworks on their Content Distribution Networks, and that using code that draws from these sources means that visitors to our websites will not have to download the scripts again, as they already have them cached (due to visiting other websites that use the same technique) which means faster download times for our web pages.
You can link to a particular version of a framework using:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js">
</script>
(Note: you will need to add http:
at the start of the URL if you trying to test the page locally. Also note that JQuery 2.0+ drops support for IE 6, 7 and 8; if support on those browsers is important to you, use ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js.)
JQuery itself also hosts the framework, distributed on Media Temple's CDN. You can link to the latest stable version by using:
But few people know that Google also hosts the popular JQueryUI plugin:
Almost no-one, it seems, is aware that Google also hosts CSS themes for JQueryUI, which are necessary for elements generated by JQueryUI to appear correctly:
Note that the CSS delivered from Google has not been minified: i.e. it still has comments, spaces, and line breaks. To get other themes, simply replace the word base in the URL with another theme, such as mint-choc, trontastic, ui-lightness, ui-darkness, or vader.
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.<script src="//code.jquery.com/jquery.min.js">
</script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js">
</script>
<link rel=stylesheet href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery-ui.css">