Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/405.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 什么是ajax错误?_Javascript_Ajax_Jquery_Client Server - Fatal编程技术网

Javascript 什么是ajax错误?

Javascript 什么是ajax错误?,javascript,ajax,jquery,client-server,Javascript,Ajax,Jquery,Client Server,什么服务器响应导致浏览器Ajax处理程序出现ajaxError? 此错误代码与200不同还是不是空的特殊json字段?是的,非200响应代码可能导致错误: httpSuccess:函数(xhr){ 试一试{ //IE error有时会在应该是204时返回1223,因此将其视为成功,请参见#1450 return!xhr.status&&location.protocol==“文件:”|| xhr.status>=200&&xhr.status=200&&xhr.status

什么服务器响应导致浏览器Ajax处理程序出现ajaxError?
此错误代码与200不同还是不是空的特殊json字段?

是的,非200响应代码可能导致错误:

httpSuccess:函数(xhr){
试一试{
//IE error有时会在应该是204时返回1223,因此将其视为成功,请参见#1450
return!xhr.status&&location.protocol==“文件:”||
xhr.status>=200&&xhr.status<300||
xhr.status==304 | | xhr.status==1223;
}捕获(e){}
返回false;
}

这是从jQuery 1.4.4开始的,之前的状态代码
0
也成功了,因为Opera
304
被报告为
0
…从那时起,宽容被删除,以消除成功的误报。如果上述检查为“假”,.

是,非200响应代码可能会导致错误:

httpSuccess:函数(xhr){
试一试{
//IE error有时会在应该是204时返回1223,因此将其视为成功,请参见#1450
return!xhr.status&&location.protocol==“文件:”||
xhr.status>=200&&xhr.status<300||
xhr.status==304 | | xhr.status==1223;
}捕获(e){}
返回false;
}
这是从jQuery 1.4.4开始的,之前的状态代码
0
也成功了,因为Opera
304
被报告为
0
…从那时起,宽容被删除,以消除成功的误报。如果上述检查为假

httpSuccess: function( xhr ) {
    try {
        // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
        return !xhr.status && location.protocol === "file:" ||
            xhr.status >= 200 && xhr.status < 300 ||
            xhr.status === 304 || xhr.status === 1223;
    } catch(e) {}

    return false;
}