Skip to content

Instantly share code, notes, and snippets.

@stephenhowells
Created May 1, 2013 17:25
Show Gist options
  • Save stephenhowells/5496740 to your computer and use it in GitHub Desktop.
Save stephenhowells/5496740 to your computer and use it in GitHub Desktop.
CDNs fail, but your scripts don't have to - fallback from CDN to local jQuery
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js"></script>
<script>
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='/js/jquery-2.0.0.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment