/ Published in: JavaScript
if the Google cdn copy of jquery or what ever fails, use a local copy of the script
Expand |
Embed | Plain Text
<!-- Grab Google CDN's jQuery. fall back to local if necessary --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> <script type="text/javascript">!window.jQuery && document.write('<script src="http://www.thiswebsitesdomain/js/jquery.js"><\/script>')</script>
Comments
Subscribe to comments
You need to login to post a comment.

you should credit the original author.
@mecha, you are absolutely right - sorry about that, I'll try to track down where I found it.
I'm a complete hack, anything I've put on this site that looks remotely intelligent is probably not mine!
Can't remember where I first found this or who originally created this technique but I've found a few others who are using it that reference Paul Irish's excellent html5 boilerplate. http://html5boilerplate.com/