$.ajax({
url : baseUrl,
data : {
"query" : query,
"num" : tracksRequested
},
dataType : "text",
success : received,
error : function(a,b,c) { alert("ERROR!"); console.log(a); },
type : "GET"
});
I am using jQuery to send AJAX requests. The code I am using is above. Usually, this works just fine. However, on occasion, the request fails and the error message appears. Upon inspection, both the ajax status code and the readyState appear to be 0, which AFAIK means the request was not sent. I was under the impression that this only happens if you try to request a page from a different domain. I am not doing that; the baseUrl variable above never changes, and yet I am getting this error on some (but not all!) of my requests. I have observed this using Chrome 13 and IE9.
Most probably, you just have connectivity issues. Why not to add error handling code and forget it? Also, that may be a bug on a server side – make sure your web server is up to date, application is working right so on.