Skip to content

Instantly share code, notes, and snippets.

@arzzen
Created Dec 7, 2015
Embed
What would you like to do?
fall back to local jquery in case cdn is unavailable
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript">
if (typeof jQuery === 'undefined')
{
// fall back to local jQuery in case CDN is unavailable
document.write('\x3Cscript type="text/javascript" src="/js/jquery.min.js">\x3C/script>');
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment