Created
August 18, 2011 17:05
-
-
Save christopherdebeer/1154542 to your computer and use it in GitHub Desktop.
tell me about it
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(url, callback){ | |
var script = document.createElement("script") | |
script.type = "text/javascript"; | |
if (script.readyState){ //IE | |
script.onreadystatechange = function(){ | |
if (script.readyState == "loaded" || | |
script.readyState == "complete"){ | |
script.onreadystatechange = null; | |
callback(); | |
} | |
}; | |
} else { //Others | |
script.onload = function(){ | |
callback(); | |
}; | |
} | |
script.src = url; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} | |
function init() { | |
console.log("all scripts loaded"); | |
} | |
loadScript("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", loadScript("http://dl.dropbox.com/u/4420775/tellmeaboutit/readability.js",loadScript("http://dl.dropbox.com/u/4420775/tellmeaboutit/speak.full.js", init()))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment