2 ms·
When you use a CDN, you can use a local fallback. Note that very old/shitty browsers won't support scheme-less URLs or jQuery 2.x, although those options are mo
by smt88 12y ago
When you use a CDN, you can use a local fallback. Note that very old/shitty browsers won't support scheme-less URLs or jQuery 2.x, although those options are more modern and preferable. You just have to make the decision based on your users.
Here's example code for local jQuery fallback:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-2.1.3.min.js">\x3C/script>')</script>
You can also use yepnope, but I don't use that personally.