递归 Ajax 调用在 IE11 中不起作用



我正在尝试使用 $.ajax jquery 方法进行背靠背的 ajax get 调用(因为我的 JSON 数据约为 2MB(,它在 Chrome 中运行良好,但 IE11 似乎无法理解。在IE11中,它落在ajax的失败方法上,在其中一个递归调用中,之后它移出递归。我在失败事件中调试并将鼠标悬停在响应文本上,它给了我带有反斜杠的字符串(长 json 的对象之一(

[{\"row_index\":\"401\",\"value\":\"希腊",\"system\":true,\"global\":true}]

但是,它在 chrome 中工作正常,即使在网络监视器 IE11 中,它也没有显示反斜杠响应。在IE11控制台中,它显示不带反斜杠的字符串

var myArray =[];
function recursiveAjax(j){
//where requestIds is like ["2","5", "1"] (list of ids) 
$.ajax({url:myURL + JSON.stringify(requestIds) + "&point1="+range[j].start+"&point2="+range[j].end +"&cacheUniq=" + (new Date()).getTime(), dataType: "json", type:'Get', cache:false, success: function (data) {
myArray.push(data)
if(j < range.length-1 )// Where range is populated array of object
{
j++;
recursiveAjax(j);
//setTimeout(recursiveAjax(j),500*j);
}   
});
})
}
recursiveAjax(0)

我在 json 数据中发现了一个特殊字符,它导致仅在 IE11 中触发错误事件

最新更新