Load jQuery from Google CDN, but fallback to local if it fails

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  3. <script type="text/javascript">
  4. if (typeof jQuery == 'undefined')
  5. {
  6. document.write(unescape("%3Cscript src='/path/to/your/jquery' type='text/javascript'%3E%3C/script%3E"));
  7. }
  8. </script>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.