Re: Simplifying element creation

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 UTC