jQuery ajax,一直調用error方法。
1 回答

皈依舞
TA貢獻1851條經驗 獲得超3個贊
一直調用error方法,請求失敗時調用此函數。有以下三個參數:XMLHttpRequest 對象、錯誤信息、(可選)捕獲的異常對象。
如果發生了錯誤,錯誤信息(第二個參數)除了得到null之外,還可能是"timeout", "error", "notmodified" 和 "parsererror"。
參考如下:
$.ajax({
url : "/education2/json/getSearchQuestionknowledgeview",
type: "post",
data : params,
dataType : "json",
cache : false,
error : function(textStatus, errorThrown) {
alert("系統ajax交互錯誤: " + textStatus);
},
.....
調試停在alert("系統ajax交互錯誤: " + textStatus);處,然后在firebug右邊的監控窗口看"textStatus",展開看有詳細錯誤細節.errorThrown中有錯誤類型。
- 1 回答
- 0 關注
- 825 瀏覽
添加回答
舉報
0/150
提交
取消