<html>
<body>
<SCRIPT type="text/javascript">
var xmlHttp = new XMLHttpRequest();
var async = true;
xmlHttp.open("GET", "http://www.google.com", async);
if(async)
{
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
if (xmlHttp.status==200) alert("It works!")
else if (xmlHttp.status==0) alert("Arggggg!")
else alert("Status is "+xmlHttp.status)
}
}
}
xmlHttp.send();
</script>
</body>
</html>
I am just curious of XMLHttpRequest to see it up and working, but I can't get status to be non-zero. The examples seem so easy, yet it's not working. I've tried about 4 examples. What the heck ?
All I want to do is read a webpage and see the HTML in plain text.