本文介绍了调试IE崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网络应用程序在Chrome和FireFox中运行良好,但在IE中却崩溃了。请注意,这不是JavaScript错误,而是iexplore.exe进程实际崩溃。

I have a web application that is working perfectly in Chrome and FireFox, yet is crashing in IE. Note, this is not a JavaScript error, but rather the iexplore.exe process actually crashes.

代码发布如下。这将在IE9中崩溃(单击按钮时)。反转JavaScript或对CSS进行更改可以消除这个问题,但要意识到这是从一个更大,更大的应用程序中减少的代码,这些代码无法以这种方式轻松更改(例如,在实际的应用程序中,两个JavaScript命令是在两个不同的函数中调用 - 第二个函数根据第一个函数的结果有条件地运行。我甚至不确定我的问题是什么,除了有没有办法让微软迅速修补这个问题?我有兴趣听听别人的想法:

The code is posted below. This will crash in IE9 (when the button is clicked). Reversing the JavaScript or making changes to the CSS may eliminate the issue, but realize that this is reduced code from a much, much larger application that can not be easily changed in this way (for example, in the actual app the two JavaScript commands are called in two different functions - the second one is run conditionally based on the results of the first). I am not even sure what my question is anymore, other than "is there a way to get Microsoft to patch this quickly?" I am interested in hearing people's thoughts:

<!DOCTYPE html>
<html>
    <head>
        <title>IE Crash</title>
    </head>
    <body>
        <div id="dvStep11" style="width:500px;">
            <label for="inpDOB">Date of Birth (mm/dd/yyyy)</label>
            <input type="text" id="inpDOB" style="width:350px;" />
        </div>
        <button onclick="document.getElementById('inpDOB').value = '12/7/1971';document.getElementById('dvStep11').style.display='none';">Click here</button>
    </body>
</html>

编辑:我已经与微软开了个案,我正在与一个开发团队成员合作。我将在收到更多信息时对此进行更新。

I have opened a case with Microsoft and am working on this with a development team member there. I will update this as I receive more information.

推荐答案

Microsoft已经向我确认这是IE9渲染引擎中的一个错误。根据我的进一步研究,它与父DIV的宽度结合INPUT的宽度导致INPUT换行这一事实有关。出于某种原因,在这种情况下,当为INPUT分配值并立即隐藏父DIV时,IE崩溃。

Microsoft has confirmed to me that this is a bug in the IE9 rendering engine. From my further research, it has to do with the fact that the width of the parent DIV, combined with the width of the INPUT causes the INPUT to wrap. For some reason, in this case when assigning a value to the INPUT and immediately hiding the parent DIV, IE crashes.

Microsoft建议我强制IE使用IE8渲染引擎(这不会崩溃)这行代码:

Microsoft suggested I force IE to use the IE8 rendering engine (which does not crash) with this line of code:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

然而,我发现我也可以通过将INPUT包装在自己的未经过固定的方式来避免这个问题DIV或SPAN。这是首选,因为除了这个bug之外,IE9渲染引擎比IE8更好(也更快)。

I found, however, that I can also just avoid the problem by wrapping the INPUT in its own unstylized DIV or SPAN. This is preferred because, aside from this bug, the IE9 rendering engine is a lot better (and faster) than IE8's.

这篇关于调试IE崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 13:46