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

Re: Simplifying element creation

From: Sean Hogan <shogun70@westnet.com.au>
Date: Thu, 06 Oct 2011 23:30:36 +1100
Message-ID: <4E8D9F6C.7030705@westnet.com.au>
To: Anne van Kesteren <annevk@opera.com>
CC: Jonas Sicking <jonas@sicking.cc>, "www-dom@w3.org" <www-dom@w3.org>
On 6/10/11 7:46 PM, Anne van Kesteren wrote:
> On Thu, 06 Oct 2011 00:51:09 +0200, Jonas Sicking <jonas@sicking.cc> 
> wrote:
>> It sounds to me like we're creating a JSON format for the DOM and
>> making element.append accept the JSON format. This doesn't sound great
>> to me. It basically sounds like too high level to fit enough use
>> cases.
>
> How it too high-level? Inserting elements and text nodes is the 80/20 
> of the DOM. And providing a viable simple alternative to innerHTML 
> seems like a major win.
>

1. A JSON to DOM converter doesn't facilitate wrapping already created 
nodes.
2. Why is this one JSON representation of the DOM better than any other?
3. How is generating a JS structure then calling Element.create(), 
node.append(), etc a win compared to generating a string of HTML then 
calling innerHTML, insertAdjacentHTML()?
4. Why can I set multiple attributes in one DOM call when creating 
elements, but not after they've been created?
5. How do I get a reference to nodes that aren't at the top of the 
generated DOM?

Sean
Received on Thursday, 6 October 2011 12:31:04 GMT

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