Skip to content

Instantly share code, notes, and snippets.

View jdrydn's full-sized avatar

jdrydn jdrydn

View GitHub Profile
@jdrydn
jdrydn / loader.js
Last active December 17, 2015 04:19
/**
* 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);