Jquery Ajax Error Handler - global error handler

Use the following code to handle errors globally in jquery based UI application.
HTTP errors can be handled based on the status code.

$( document ).ajaxError(function( event, jqxhr, settings, exception ) {
        if (jqxhr.status == 401 ) {
                alert(jqxhr.responseText);
        }
});

Search