Saturday, December 28, 2013

jQuery CDN fallback

cdn - Best way to use Google's hosted jQuery, but fall back to my hosted library on Google fail - Stack Overflow

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

Google Hosted Libraries - Developer's Guide - Make the Web Faster — Google Developers


jQuery source viewer

No comments: