Home
> Uncategorized > Ajax HTTP status code 0 (zero)
Ajax HTTP status code 0 (zero)
I find that when I encounter a HTTP status code of 0 when using Ajax, it means there is some network error between the client and server, for example, a firewall issue, a network failure, or such forth.
The type of issue was spotted in code that looks like this;
$.get(“http://www.somedomain.com/yourajax.aspx”,function(data){
// Success case
}).fail(function(xhr,status){
if (xhr.status == 0)
{
// Network problem?
}
});
Of course, this is only likely to occur in cross-domain ajax, since it is unlikely for a server to serve a page, and then immediately become unreachable to ajax.
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback