第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

jQuery ajax,一直調(diào)用error方法。

jQuery ajax,一直調(diào)用error方法。

回首憶惘然 2018-12-05 05:05:36
<script type="text/javascript">alert(111);$.ajax({ type: "GET",dataType:"text",url:"http://202.117.191.165/RestTest/services/getOtherLectures/getOtherLectures",data:{"serverip":"127.0.0.1"},contentType: "json", success:function(response){alert(response+"成功");},error:function(data) { alert(data,"error");}});</script>通過瀏覽器訪問直接訪問時,是可以進入到action中的,用傳統(tǒng)的ajax也可以返回結(jié)果。請大家分析一下是什么原因。
查看完整描述

1 回答

?
三國紛爭

TA貢獻1804條經(jīng)驗 獲得超7個贊

 一直調(diào)用error方法,請求失敗時調(diào)用此函數(shù)。有以下三個參數(shù):XMLHttpRequest 對象、錯誤信息、(可選)捕獲的異常對象。
  如果發(fā)生了錯誤,錯誤信息(第二個參數(shù))除了得到null之外,還可能是"timeout", "error", "notmodified" 和 "parsererror"。
  參考如下:
  $.ajax({
  url : "/education2/json/getSearchQuestionknowledgeview",
  type: "post",
  data : params,
  dataType : "json",
  cache : false,
  error : function(textStatus, errorThrown) {
  alert("系統(tǒng)ajax交互錯誤: " + textStatus);
  },
  .....
  調(diào)試停在alert("系統(tǒng)ajax交互錯誤: " + textStatus);處,然后在firebug右邊的監(jiān)控窗口看"textStatus",展開看有詳細錯誤細節(jié).errorThrown中有錯誤類型。

查看完整回答
反對 回復(fù) 2018-12-20
  • 1 回答
  • 0 關(guān)注
  • 617 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號