I am using the following jQuery JSONP request to check the status of a resource by URL. When the resource is not available or the server is down, my ajaxFail()
function updates the display.
function fetchServerStatus(service, host)
{
var port = serverStatus[service].port;
$.ajax({
url: "http://" + host + ":" + port + "/admin/server/status",
dataType: "jsonp",
timeout: 1000,
error: ajaxFail,
fail: ajaxFail,
success: ajaxDone,
done: ajaxDone,
complete: ajaxAlways,
always: ajaxAlways
});
}
The problem I'm having is that despite declaring handlers for fail
and error
, which do not log anything to the console, jQuery always logs the failed request in the console. If the resource is unavailable for a long time, this builds up a huge console log, eventually crashing the browser process (Chrome in my case).
Is there any way to stop it from doing this?