检测IE操作中止问题的原因

问题描述:

我的网站遇到了操作中止错误.我觉得很奇怪,就我而言,该错误有时仅会发生.该网站已经运行了三个月,但今天开始运行,但并非每次都可以.

My site is suffering from the Operation Aborted error. What I find weird is that in my case the error only sometimes happens. The site has been running fine for three months then today it starts happening but not every time.

此页面所在的页面很大,带有许多第三方控件.我想要的是一种可以确定故障发生位置的工具.似乎我能做的最好的事情是找到操作中止后发生的第一个javascript错误;但是,这并没有太大帮助.失败的原因是自IE停止解析HTML以来,我所期望的dom元素不可用.

The page this is occuring on is rather large with a lot of third party controls. What I'd like is a tool that could pinpoint where the failure is occuring. Seems like the best I can do is find the first javascript error that occurs after the operation aborted; however, this doesn't help much. This failure is because an element of the dom isn't available which I'd expect since IE stopped parsing the HTML.

任何人都有任何想法或技巧来缩小范围吗?

Any one have any ideas or tricks to narrow this down?

我感谢您解决此问题的其他方法;但是,我正在寻找一种识别导致该问题的脚本的方法.

I appreciate additional ways to resolve the issue; however, what I am looking for is a way to identify which script is causing the issue.

切换到IE8后,我能够确定原因是AjaxControl Toolkit的模式弹出对话框.没有确定这种令人失望的具体方法,但是调试器让我看到了失败的地方,这是非常一致的.由于控件中没有办法告诉它移动其初始化,因此我将其禁用,并使用脚本在我的文档加载事件处理程序中创建客户端控件.

After switching to IE8, I was able to determine the cause was the AjaxControl Toolkit's modal popup dialog. There was no concrete way to determine this which is dissapointing, but the debugger let me see where it was failing which was very consistent. Since there is no way in the control to tell it to move its initialization, I disabled it, and have the script to create the client side control in my document load event handler.

此问题不是控件的错,它的发生是因为弹出窗口的内容实际上是第二种形式.坦白地说,我很惊讶它能奏效.

This issue is no fault of the control, it was occuring because the content for the popup is actually in a second form. Frankly I'm surprised it ever worked.

您是否有操纵DOM的任何JavaScript,具体情况请参见

Do you have any javascript that is manipulating the DOM, as the case is described at http://support.microsoft.com/kb/927917#more_information ?

请尝试将所有脚本块移到页面的最底部,恰好在</body>标记之前,并且不要尝试设置body标记本身的innerHTML属性.

Try moving all script blocks to the very bottom of the page, just before the </body> tag, and don't try to set the innerHTML property of the body tag itself.

如果问题是在完全构建DOM之前执行javascript,请尝试将所有初始化调用移入仅在页面完全加载后才能运行的函数.因此,不要像这样:

If the problem is with javascript executing before the DOM is fully built, try moving any initialization calls into a function that will run only after the page is fully loaded. So, instead of something like this:

<div class="myWidgetControl"/>
<script type="text/javascript">
  initializeWidgets();
</script>

尝试这样的事情:

<div class="myWidgetControl"/>
<script type="text/javascript">
  $(document).ready(
    function () { initializeWidgets(); }
  );
</script>