Created
June 6, 2014 14:16
-
-
Save schickling/82dc62e0712b38b8d461 to your computer and use it in GitHub Desktop.
Minimal dynamic javascript loader
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
function loadScript(src) { | |
var el = document.createElement('script'); | |
el.setAttribute('src', src); | |
el.async = false; | |
document.body.appendChild(el); | |
} | |
[ | |
'jquery.js', | |
'main.js', | |
].forEach(loadScript); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment