我有以下的Ajax请求:
jQuery.ajax({
async: true,
type: "GET",
url: url,
data: data,
dataType: "json",
success: function(results){
currentData = results;
},
error: function(xhr, ajaxOptions, thrownError){
if (xhr.status == 200) {
console.debug("Error code 200");
}
else {
currentData = {};
displayAjaxError(xhr.status);
}
}
});
出于某种原因,错误回调被称为事件虽然HTTP状态代码是200,即。该请求是确定的。为什么是这样?
我测试过这个,看起来没关系。 ks)有和没有内容类型声明的两种方式。 – kosoant 2009-12-04 14:00:45
嗯,也许这是原型库,而不是jQuery然后 – Greg 2009-12-04 14:22:31