.ajaxError() in jQuery

It helps to register a handler , to be called when Ajax requests complete with an error.

.ajaxError()

// an alert box will display , when an AJAX request fails

$( document ).ajaxError(function() {
alert(“An error occurred in Ajax action!”);
});