我有以下的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