Skip to content

Instantly share code, notes, and snippets.

@carlcarl
Created April 6, 2013 15:04
Show Gist options
  • Save carlcarl/5326393 to your computer and use it in GitHub Desktop.
Save carlcarl/5326393 to your computer and use it in GitHub Desktop.
if (!($ = window.jQuery)){ // typeof jQuery=='undefined' works too
script = document.createElement( 'script' );
script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
script.onload=dosomething;
document.body.appendChild(script);
}
else{
dosomething();
}
function dosomething(){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment