XMLHttpRequest Sandbox
Sandbox for testing XMLHttpRequest.
HTML
<div id="display"></div>
JavaScript
var elm = document.getElementById('display');
function getReel() {
var async = true;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
elm.innerHTML = xhttp.responseText;
}
};
xhttp.open("GET", "http://localhost:8080/", async);
//xhttp.setRequestHeader('Accept', 'text/html');
xhttp.send();
}
getReel();