Aaron J Spetner
Aaron J Spetner

Reputation: 2155

Debugging an IE crash

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.

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>

Edit: 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.

Upvotes: 3

Views: 4744

Answers (2)

Aaron J Spetner
Aaron J Spetner

Reputation: 2155

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 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" />

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.

Upvotes: 9

Armatus
Armatus

Reputation: 2191

Funnily, the debugger IE9 brings is quite useful with break points, variable tracking and such, so I would try and see if that can be of any help. (If you can get IE9; I'm not sure about the dev tools in IE 7 and 8).

Upvotes: 0

Related Questions