[whatwg] Mechanism to find available events

Jonas Sicking jonas at sicking.cc
Mon Sep 20 20:52:59 PDT 2010

On Mon, Sep 20, 2010 at 8:50 PM, Biju <bijumaillist at gmail.com> wrote:
> On Mon, Sep 20, 2010 at 11:37 PM, Jonas Sicking <jonas at sicking.cc> wrote:
>> if (onhashchange in document.body) {
>>  ...
>> }
> assuming
>    if ('onhashchange' in document.body) {
> That should solve one issue, but Firefox is not doing that for all events,
> example:-  'onbeforeunload' in window ===> gives false
> also there is no way to discover the all the available events for a node.

Indeed, in general we have very poor handling of on* properties. Our
code for dealing with that needs a rewrite.

But my point was that I think the spec already might have a mechanism
for dealing with what you are asking for. So we should encourage
implementations to implement the spec properly, rather than adding
other mechanisms and hoping that browsers get those more right.

/ Jonas

More information about the whatwg mailing list