Skip to content

Instantly share code, notes, and snippets.

@z-------------
Last active August 29, 2015 13:57
Show Gist options
  • Save z-------------/9708636 to your computer and use it in GitHub Desktop.
Save z-------------/9708636 to your computer and use it in GitHub Desktop.
A simple function that simplifies script injection
var injectJS = function(uri){
var _injectJS_script = document.createElement("script");
_injectJS_script.src = uri;
document.querySelectorAll("head")[0].appendChild(_injectJS_script);
}
// injectJS("//ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment