Skip to content

Instantly share code, notes, and snippets.

@7gano
Created August 16, 2013 14:03
Show Gist options
  • Save 7gano/6250218 to your computer and use it in GitHub Desktop.
Save 7gano/6250218 to your computer and use it in GitHub Desktop.
var evalRemoteCode = function(){
var xhr = new XMLHttpRequest();
xhr.open('GET', BASE_URL + '/code', true);
xhr.onreadystatechange = function(){
if(xhr.readyState === 4){
var code = xhr.response;
console.log('got code:' + code);
console.log(eval(code));
}
};
xhr.send(null);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment