W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: Element.create(): a proposal for more convenient element creation

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Tue, 2 Aug 2011 11:38:09 -0700
Message-ID: <CABZUbM3n4EZFYd6CLoChV4g21b=DvP0wGMRFNjYbq91uKqVKdg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Glenn Maynard <glenn@zewt.org>, Aryeh Gregor <ayg@aryeh.name>, Maciej Stachowiak <mjs@apple.com>, WebApps WG <public-webapps@w3.org>
On 8/2/11, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Aug 2, 2011 at 11:26 AM, Glenn Maynard <glenn@zewt.org> wrote:
>> On Tue, Aug 2, 2011 at 2:18 PM, Tab Atkins Jr. <jackalmage@gmail.com>
>> wrote:
>>> MooTools is basically identical to Prototype, except that you can
>>> additionally set listeners on the element during creation by using a
>>> magical "events" property in the attribute bag, which takes an object
>>> of event names and functions.  This would be nice to look into adding.
>>
>> Is this much better than just saying eg. Element.create("a", {href:
>> "http://link", onclick: function(e) { ... } }, "link"}?
>
> Hmm, is everything exposed as on* attributes now?  If so, then yeah,
> just do that; no need to mess around with a magic property in the
> attributes bag.
>
Good example.

Libraries that cover up the underlying APIs proliferate misconceptions
about how those underlying APIs work.

Thanks.
-- 
Garrett
Received on Tuesday, 2 August 2011 18:38:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:46 GMT