[whatwg] window.onerror

Ian Hickson ian at hixie.ch
Sat Aug 28 06:48:25 PDT 2004


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.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list