Javascript 什么是ajax错误?
什么服务器响应导致浏览器Ajax处理程序出现ajaxError?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
此错误代码与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
也成功了,因为Opera304
被报告为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
也成功了,因为Opera304
被报告为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;
}