[whatwg] Mechanism to find available events

Jonas Sicking jonas at sicking.cc
Mon Sep 20 20:37:31 PDT 2010


On Mon, Sep 20, 2010 at 8:15 PM, Biju <bijumaillist at gmail.com> wrote:
> https://bugzilla.mozilla.org/show_bug.cgi?id=264525
>
> We need
> HTMLNode.getSupportedEvents()  ==> returns a text array of event names
> HTMLNode.isSupportedEvent(eventName)  ==> returns true/false
>
> Many times in particular version of browser we dont know whether an
> HTMLNode/window support particular event.
> Or what are the alternate events available, so that we can refer some
> document or do some test to find how it can be used.
> So I wish we had above methods available.

When we implemented the hashchange event defined by HTML5, we made
sure that you could test for it using

if (onhashchange in document.body) {
 ...
}

Would that not work?

/ Jonas



More information about the whatwg mailing list