Wednesday, March 21, 2012

Internet Explorer 9: JavaScript window.onerror event

For a web application we are building, I added some global error handling behavior using the window.onerror event

But when debugging the application I noticed that the onerror event was never called. I lost a lot of time until I discovered that it was an IE9 only issue.

This fact brought me to the this forum post(Error Handling in IE9) where I found the following information:

“In IE9 when debugging is enabled the window.onerror listener does not get fired as the error was essentially passed to the debugger. The only workaround is to disable debugging. Alas there isn't a work around for this and so far we haven't received any servicing requests for a patch, but if you need one please do contact support / your MS account rep.

In IE10 the behavior was reverted back to the IE8 behavior and onerror should will always be called.”

So if I run the application without a debugger attached, it should work fine. Always fun, this browser specific behavior…

1 comment:

jowdjbrown said...

This fact brought me to the this forum post(Error Handling in IE9) where I found the following information:psd to html