On May 30, 9:06 am, "Mislav Marohnić" <[EMAIL PROTECTED]>
wrote:
> On 5/30/07, timcharper <[EMAIL PROTECTED]> wrote:
>
>
>
> > What do you think if we added a shortcut method to
> > an instantiated method capable of building and appending a new element
> > to it in one swoop?
>
> So you're proposing a wrapper around "new Element(); appendChild()"? It's
> useful, yeah... But is "build" a right name? How about "append":
>
> div.append('p', { className: 'foo' })
>
> And what should the build method return? The div or the new element? The
> latter is more useful but breaks consistency.
While "build" works, perhaps there is a better name. Maybe "create",
or "append_new"? "Create" implies that I will be returned the new
element. "Append_new" or "insert_new" don't imply that. I think in
order for it to be useful, it will need to return the new element.
Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---