您可以使用全局ajax事件处理程序.ajaxError()
$( document ).ajaxError(function( event, jqxhr, settings, exception ) { if ( jqxhr.status== 401 ) { $( "div.log" ).text( "Triggered ajaxError handler." ); }});
您可以使用全局ajax事件处理程序.ajaxError()
$( document ).ajaxError(function( event, jqxhr, settings, exception ) { if ( jqxhr.status== 401 ) { $( "div.log" ).text( "Triggered ajaxError handler." ); }});