Skip to content

Instantly share code, notes, and snippets.

@Ivanca
Last active December 10, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ivanca/4444636 to your computer and use it in GitHub Desktop.
Save Ivanca/4444636 to your computer and use it in GitHub Desktop.
var url = document.location.href;
var cdnFallback = /\bcdn=2/.test(url);
setTimeout(function(){
if( !window.jQuery && !cdnFallback )
document.location += (/\?/.test(url) ? "&" : "?") + "cdn=2";
},400);
if( cdnFallback ){
document.write('<script src="js/jquery-1.8.3.min.js"></scr'+'ipt>');
} else {
document.write('<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></scr'+'ipt>');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment