我是Ajax的新手 . 我正在进行ajax调用并将该数据显示为表格格式 . 我已在所有浏览器(Chrome,FireFox和IE)中测试了此代码 . 它按预期工作 .

Issue :在IE中启用Compatability模式后,有时表数据正在加载,有时无法加载 . 它会自动转到错误函数方法 .
它显示消息' Unable to load the data into the table. '而不是显示表数据 .

Sample Code

function loadTable(dataItem, container){
...      
...
$.ajax({
  url: "/modules/Demo/services/ReportData",
  type: "POST",
  traditional: true,
  data: {
            param1: param1Array,
            param2: calcArray,  
        },
        success: function (data) {
          ....
          ....
          ....            
        },
        error: function () {
            container.text("Unable to load the data into table.");
        }
    });
}

<div class="reportData" id="displayData" style="margin-top:20px;">
</div>

我添加了以下代码来检查错误日志

error: function(jqXHR, textStatus, errorThrown) {       
$('#result').html('<p>status code: '+jqXHR.status+'</p><p>errorThrown: ' + errorThrown + '</p><p>jqXHR.responseText:</p><div>'+jqXHR.responseText + '</div>');
console.log('jqXHR:');
console.log(jqXHR);
console.log('textStatus:');
console.log(textStatus);
console.log('errorThrown:');
console.log(errorThrown);
}

Console Log content

jqXHR:
[object Object]{readyState: 4, responseText: "[  {"xyz ...", status: 200, statusText: "parsererror"}
[object Object]
 {
[functions]: ,
 readyState: 4,
 responseText: "[//It displaying application data that i should not share here
{
 status: 200,
 statusText: "parsererror"}
 textStatus:
parsererror
errorThrown:
[object Error]
 {
 message: "JSON.parse",
 name: "SyntaxError"

看来,根据日志,它说parseError意味着无法解析数据 . 我无法理解,有时它是有效的,有时它不起作用 .

Additional Analysis in Debug console - Response Body Section
我们正在使用脚本解析数据 . 我在 chrome 中选择了2010年到2018年的日期范围 . 按F12键进入网络选项卡 . 响应机构具有以下数据 .

[
{"Salary":12345.25,"Employee Age Limit":"0-17","Joining type":"Immediate","Joining date":"2010-01-19"},
{"Salary":24567.25,"Employee Age Limit":"0-20","Joining type":"Immediate","Joining date":"2010-01-20"},
...
...
...
]

总行数:我看到响应体的8000个 . 表正在正确加载 .

在IE兼容模式下 Success scenario:
选择了2010年到2011年的日期范围 . (此范围仅有500条记录 . )我可以在响应正文中看到500个,数据正确加载 .

IE兼容模式下的 Failure scenario: 选择2010年到2018年的日期范围 . 然后报告 . 并在ResponseBody部分中收到类似'Unable to load the data into the table'分析详细信息的错误消息 .
有时我看到有无效数据的3500rows,有时候我看到1500个数据不完整的数据

[
{"Demo ds abc totals":123.25,"Employee Age Limit":"0-17","Joining type":"Immediate","Joining date":"2010-01-19"},
{"Demo ds abc totals":245.25,"Employee Age Limit":"0-20","Joining type":"Immediate","Joining date":"2010-01-20"},
...
...
...
{"Demo ds abc totals":245.25,"Employee Age Limit":"0-20","Joining type":"Immediate",

如何解决上述问题

请帮我 . 提前致谢 .