My first and very simple AJAX request not outputting “status 200 OK”.. and instead outputs “0” .. What’s wrong?
function doit(){
var httpxml = new XMLHttpRequest();
httpxml.onreadystatechange = function(){
if(httpxml.readyState == 4) {
alert(httpxml.status);
}
}
httpxml.open("GET", "http://localhost/test/ROUGH/TEST.php", true);
httpxml.send(null);
}
doit();
The main reason for status 0 is that it has run from the disk and not through a webserver.