W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

Re: ECMAScript binding for EventListener

From: Jim Ley <jim@jibbering.com>
Date: Fri, 15 Jun 2001 14:46:27 -0000
Message-ID: <009801c0f5a9$f53763e0$ca969dc3@emedia.co.uk>
To: "Dylan Schiemann" <dylans@yahoo.com>, "Johnny Stenback" <jst@netscape.com>
Cc: <www-dom@w3.org>
> --- Johnny Stenback <jst@netscape.com> wrote:
>
> Not necessarily.  However, something equivalently
> simple would be nice.  Jeff's idea works, but it isn't
> as clean as it should be.

As clean as it should be in what sense, the functionality exists, you
just have to use slightly different syntax:

Instead of: (from David Flanagan's post.)
element.addEventListener("click", { message: "Hello world",  handleEvent:
function(e) { alert(this.message); } },  false);

you just have
element.addEventListener("click", ({ message: "Hello world",
handleEvent: function(e) { alert(this.message); } }).handleEvent,
false);

It's not a lot of different, it's still reasonably neat.   I don't see
the point in making things more complicated for no reason, keep the
implementation simple, and small, and fast and only add features that are
truly of value, I'm still unsure as to exactly where this would be of
particular value - are there any non trivial examples?

Jim.
Received on Friday, 15 June 2001 10:48:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT