Last active
December 17, 2015 04:19
-
-
Save jdrydn/5549822 to your computer and use it in GitHub Desktop.
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
/** | |
* 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'); js.id = id; js.src = scripts[id]; | |
d.body.appendChild(js); | |
} | |
}(document, { | |
"jquery": "//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js", | |
"moment": "//rawgithub.com/timrwood/moment/2.0.0/min/moment.min.js", | |
"advice": "/js/advice.js" | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment