Skip to content

Instantly share code, notes, and snippets.

@solomon081
Created June 25, 2012 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solomon081/2986071 to your computer and use it in GitHub Desktop.
Save solomon081/2986071 to your computer and use it in GitHub Desktop.
getScript
function getScript(url) {
var xml = new XMLHttpRequest();
xml.onreadystatechange = function () {
if (xml.readyState === 4 && xml.status === 200) {
eval(xml.responseText);
console.log("Evaluated the Javascript.");
}
}
xml.open("GET", url, true);
xml.send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment