hello, i got following part of one of functions
if(continiueSend)
{
$.ajax
({
type: "POST",
url: "mailer.php",
data: "somestestdata",
timeout: 5000,
success: function(a)
{
alert(a);
},
error: function (xhr, ajaxOptions, thrownError)
{
alert(xhr.status);
alert(thrownError);
}
});
}
And it works great when server is ok, requested data are sent in less than 100ms, in case when i turnoff sever it also works great,script reports errors as it expected, but there is problem when server is busy
When time of sending data exceeds limit set with "timeout:" error handling as specified in "error:" isn't fired, and in console appears following information
uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://127.0.0.1/site/index.php?article=2 :: anonymous :: line 252" data: no]
Line 252 is first line of mentioned code. I tryied to put code inside IF brackets into try...catch but with no results.
How I can properly detect this exception to handle it the way i want?
MTH