我在我的页面上运行的以下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);
- }