Last active
August 29, 2015 13:57
-
-
Save z-------------/9708636 to your computer and use it in GitHub Desktop.
A simple function that simplifies script injection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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