Re: EventTarget.on

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 UTC