JSFiddle - React, Tailwind, and code Playground
by podlipensky
JavaScript
var executeScript = function(code){
eval(code);
};
var xhr = new XMLHttpRequest();
var checkStatus = function(){
if(xhr.readyState == 4){
if(xhr.status >= 200 && xhr.status < 300 || xhr == 304){
executeScript(xhr.responseText);
}
else {//error
}
}
};
xhr.open('get','http://podlipensky.com/examples/dynamicscript/hey.js', true);
if(xhr.onreadystatechange){//case of IE
xhr.onreadystatechange = checkStatus;
}
else {//other browsers
xhr.onload = checkStatus;
}
xhr.send(null);