Return to Snippet

Revision: 55295
at February 1, 2012 20:34 by cyberpunkstudio


Initial Code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>

Initial URL

                                

Initial Description
Grab jQuery library from Google's CDN this way its faster, burns Google's bandwidth and not yours. Also users will have this cached if other sites are using it as well. 

Downside of course is Google's servers do go down. This script will check if its available on Google's servers otherwise fall back to your local version.

Initial Title
Grab jQuery library from Google's CDN if failed then pull local version

Initial Tags
javascript, jquery

Initial Language
JavaScript