Skip to content

Instantly share code, notes, and snippets.

Last active Dec 17, 2015
What would you like to do?
* A really nice way to dynamically load JavaScript files.
* Place this at the bottom of HTML files to load JavaScripts after pageload! :)
* The cake is still a lie.
(function(d, scripts){
for(var id in scripts) if (d.getElementById(id) == null) {
var js = d.createElement('script'); = id; js.src = scripts[id];
}(document, {
"jquery": "//",
"moment": "//",
"advice": "/js/advice.js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment