error

Test page.

Events overview page.

The error event fires when the browser encounters a JavaScript error or when an image file does not exist.

Event IE 5.5 IE 6 IE 7 IE8rc1 as IE7 IE8rc1 as IE8 FF 2.0 FF 3.0 FF 3.1b2 Saf 3.0 Win Saf 3.1 Win iPhone 3G Chrome 1.0 Opera 9.62 Opera 10a Konqueror 3.5.7
On the window
Incomplete Incomplete No No No No

When the browser encounters a JavaScript error it should fire the error event from the window.

  • IE and Firefox give the event type undefined in the traditional event handler registration. Also, the event fires on the link that contains the faulty code, and not on the window.
On the document
No No No No Yes Yes

Is the error event available on the document?

On an image
Yes Yes Yes Yes Yes Yes

When an image file does not exist the error event should fire.

Event bubbling

The spec says this event should bubble, but most browsers disagree.

No No Untestable Untestable Yes No
Event IE 5.5 IE 6 IE 7 IE8rc1 as IE7 IE8rc1 as IE8 FF 2.0 FF 3.0 FF 3.1b2 Saf 3.0 Win Saf 3.1 Win iPhone 3G Chrome 1.0 Opera 9.62 Opera 10a Konqueror 3.5.7