W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] window.onerror

From: Ian Hickson <ian@hixie.ch>
Date: Sat, 28 Aug 2004 13:48:25 +0000 (UTC)
Message-ID: <Pine.LNX.4.61.0408281344450.8458@dhalsim.dreamhost.com>
On Sun, 22 Aug 2004, [ISO-8859-1] Olav Junker Kj?r wrote:
> Ian Hickson wrote:
> > > It would be nice to formalize window.onerror as part of WAML. It is widely
> > > supported (at least both IE and Mozilla has it) but not part of any
> > > standard
> > > as far as I know. I think it is important for the robustness of web apps.
> >  Is there any documentation that defines exactly what it is?
> 
> It's an event handler that is called when an error happens in script - kind of
> like a global catch-block.
> 
> This is the documentation for IE:
> http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onerror.asp
> And this is for Mozilla:
> http://www.mozilla.org/docs/dom/domref/dom_window_ref58.html

Hmm. That documentation doesn't really help. What are the arguments that 
are passed to onerror? Is it an "event" object as normal? Or is onerror 
not a DOM-like event but just a function pointer? Can you addEventListener 
the error event, or is it only accessible from window.onerror as a 
callback? If it's a normal DOM event, what does its interface look like?

I tried looking up this information on MSDN and in the Mozilla sources but 
came up mostly empty.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 28 August 2004 06:48:25 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:36 UTC