Skip to content

Instantly share code, notes, and snippets.

@marshall007
Created June 27, 2013 17:02
Show Gist options
  • Select an option

  • Save marshall007/5878229 to your computer and use it in GitHub Desktop.

Select an option

Save marshall007/5878229 to your computer and use it in GitHub Desktop.
var inject_script = function(source) {
if (!source) source = "//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.js";
var script = document.createElement("script");
script.src = source;
script.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
var listen = setInterval(function() {
if(typeof jQuery !== 'undefined') {
$ = jQuery;
clearInterval(listen);
}
},50);
};
inject_script();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment