$.ajax({ url : rootPath+"/doRegister", type: "post", data : dates, contentType : "application/x-www-form-urlencoded; charset=UTF-8", timeout : 30000, dataType :"json", cache : false, error : function(e) { console.log(4441); console.log(e) alert("使用者註冊網路連接出錯~"); window.location.reload(); }, success : function(obj) { console.log(4442) //重啟伺服器,令牌失效,重新擷取令牌 if (typeof (obj) == 'undefined' || obj == null) { window.location.reload(); } if (obj.rs) { window.location.href = rootPath+"/loginRule"; } else { alert(obj.msg); $("#_form_token_uniq_id").val(obj.token.token); } }
回複內容:
$.ajax({ url : rootPath+"/doRegister", type: "post", data : dates, contentType : "application/x-www-form-urlencoded; charset=UTF-8", timeout : 30000, dataType :"json", cache : false, error : function(e) { console.log(4441); console.log(e) alert("使用者註冊網路連接出錯~"); window.location.reload(); }, success : function(obj) { console.log(4442) //重啟伺服器,令牌失效,重新擷取令牌 if (typeof (obj) == 'undefined' || obj == null) { window.location.reload(); } if (obj.rs) { window.location.href = rootPath+"/loginRule"; } else { alert(obj.msg); $("#_form_token_uniq_id").val(obj.token.token); } }
我剛剛也遇到這個情況了,我的是因為服務掛了。
截少了,f12看它返回來的錯誤碼是多少,是否是請求報錯400……
你應該放response的才能方便定位錯誤
你的不完全,由於不全,所以初步只能估計是因為400錯誤,或者是介面處返回的資料並不是想要的資料格式。而且你並沒有將回應標頭也就是response headers截出來,所以比較抱歉,這種只能初步估計是沒有響應!