简体   繁体   English

IE中的Ajax请求随机中止

[英]Ajax request randomly aborted in IE

I'm having an intermittent problem with my Ajax call in IE9. 我在IE9中的Ajax通话遇到间歇性问题。 Here is my code 这是我的代码

 $.ajax({
    url: buildUrl('ActiveTasksTable/' + $('#Id').val()),
    type: "POST",
    cache: false,
    data: data,
    traditional: true,
    success: function (data) {
        $('.expandable-content-loading', section).hide();
        $('.expandable-content', section).html(data);

        initTableActiveTasks(type, section);
    },
    error: function (jqXHR, textStatus, somethingElse) {
        $("body").html(jqXHR.responseText);
    }
});

Heres my setup 这是我的设置

  • IE9 IE9
  • JQuery 1.9.1 jQuery 1.9.1
  • MVC3 MVC3

Sometimes this ajax request comes back valid and sometimes it errors. 有时,此ajax请求返回有效,有时则出错。 I have checked in fiddler and the response is a 504 Gateway Timeout Error and the response text is empty. 我已经检查了提琴手,响应是504网关超时错误,响应文本为空。 However when I check this in IE developer tools, the response is Aborted. 但是,当我在IE开发人员工具中进行检查时,响应已中止。

Ive tested this in FF and Chrome and they ALWAYS return a valid response. 我已经在FF和Chrome中对此进行了测试,并且它们始终会返回有效的响应。 Is this a problem with IE? IE有问题吗? Is there a workaround for this? 有没有解决方法?

Any help is greatly appreciated. 任何帮助是极大的赞赏。 I've been trying to figure this out all week :( 我一直在努力弄清楚这整个星期:(

This turned out to be a problem with the load balancer. 事实证明这是负载平衡器的问题。 Occasionally this happened when the packet acknowledgment took longer than 2seconds between servers. 有时,当服务器之间的数据包确认时间超过2秒时,就会发生这种情况。

We installed the application on another server and we no longer experience this problem. 我们在另一台服务器上安装了该应用程序,我们不再遇到此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM