Skip to content

Instantly share code, notes, and snippets.

@christopherdebeer
Created August 18, 2011 17:05
Show Gist options
  • Save christopherdebeer/1154542 to your computer and use it in GitHub Desktop.
Save christopherdebeer/1154542 to your computer and use it in GitHub Desktop.
tell me about it
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