Created
March 14, 2012 05:04
-
-
Save tlrobinson/2034215 to your computer and use it in GitHub Desktop.
This file contains hidden or 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(url, callback) { | |
var script = document.body.appendChild(document.createElement("script")); | |
script.onload = callback; | |
script.src = url; | |
} | |
function loadScripts(scripts, callback) { | |
dependencies.reverse().reduce(function(next, url) { | |
return loadScript.bind(null, url, next); | |
}, callback)(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment