Source: http://www.fcgood.com/Program/AJAX/3562.html
Why is XMLHTTP. status not 200 in Ajax?
In Ajax, the status attribute of the XMLHTTPRequest object is generally used to return the HTTP status code of the server. Status 200 indicates "successful", and status 404 indicates "Page not found ". Many books are written in this way, which is not bad at all.
However, sometimes, especially when learning Ajax, the Code may run directly locally. In this case, the problem occurs. If you run locally (for example, c: \ Ajax \ helloworld.htm), the status attribute returns 0 if it is "successful" or "not found on the page, instead of 200 and 404. At this time, if you still use if (XMLHTTP. Status = 200) to judge the operation, there will be no results. If you want to test it locally, you 'd better write it as if (XMLHTTP. Status = 200 | XMLHTTP. Status = 0.
As I mentioned earlier, this does not mean that many books or articles are wrong. Because all these articles write the status returned from the server, but they do not say that the returned status from the local server is missing.