Jquery Ajax error handling to ignore aborted

后端 未结 9 731
栀梦
栀梦 2020-12-07 17:35

I want to have a global error handling method for ajax calls, this is what I have now:

$.ajaxSetup({
  error: function (XMLHttpRequest, textStatus, errorThro         


        
9条回答
  •  感情败类
    2020-12-07 18:07

    $(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
    
        if (!jqXHR.getAllResponseHeaders()) {
            return;
        }           
    }); 
    

提交回复
热议问题