W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

Re: EventTarget.on

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 23 Nov 2011 11:49:26 -0500
Message-ID: <CABirCh-DFYQOtPU=YTH7vPaZvwaaxjUoRHZ3bL0S4JKqnzgXvQ@mail.gmail.com>
To: Jake Verbaten <raynos2@gmail.com>
Cc: Anne van Kesteren <annevk@opera.com>, www-dom@w3.org
On Wed, Nov 23, 2011 at 11:33 AM, Jake Verbaten <raynos2@gmail.com> wrote:

> "on" is a method added to Element.prototype by jQuery and Prototype, so
>>>> this seems like it would just be asking for problems and confusion.
>>>
>>>
> jQuery doesn't add on http://jsfiddle.net/HkWLN/
>
> Prototype doesn't add on http://jsfiddle.net/HkWLN/1/
>

Prototype certainly does; it's in HTMLElement.prototype.

jQuery puts it behind $(), but that's not much less confusing (it avoids
compatibility problems, at least).

Adding a redundant method that clashes with what everyone already
associates with the name (event delegation), just to save a few bytes, is
definitely not worthwhile.

-- 
Glenn Maynard
Received on Wednesday, 23 November 2011 16:50:24 GMT

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