相关疑难解决方法(0)

chrome中的jquery ajax问题

我在我的页面上运行了以下jquery代码,在FF和IE中运行良好,但Chrome似乎很吓人......

在FF和IE中进行调用,结果附加到div.在chrome中,它在失败时调用ajaxfailed.

传递给AjaxFailed函数的XMLHttpRequest的状态代码为"200",statusText为"ok".readystate是4,responseText被设置为我希望附加到div的数据..基本上从我可以看到它调用失败方法,但它没有失败..我尝试了get和post请求和它总是打破铬.

function getBranchDetails(contactID, branchID) {
  $.ajax({
    type: "GET",
    url: urlToRequestTo,
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: branchDetailsSuccess,
    error: AjaxFailed
  });
}



 function branchDetailsSuccess(result) {
      $("#divBranchControl").empty();
      $("#divBranchControl").append(" " + result);
      $("#branchDiv").tabs();
    }



 function AjaxFailed(result) {
      alert("FAILED : " + result.status + ' ' + result.statusText);
    }
Run Code Online (Sandbox Code Playgroud)

ajax jquery google-chrome

21
推荐指数
4
解决办法
7万
查看次数

标签 统计

ajax ×1

google-chrome ×1

jquery ×1