Skip to content

Instantly share code, notes, and snippets.

@freshsnippets
Created March 8, 2012 16:56
Show Gist options
  • Save freshsnippets/2002052 to your computer and use it in GitHub Desktop.
Save freshsnippets/2002052 to your computer and use it in GitHub Desktop.
JavaScript: Fallback for CDN hosted jQuery
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
    document.write(unescape("%3Cscript src='/js/jquery-1.9.1.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