> The main rationale is: whenever non-buggy, use innerHTML as it's going to be
> *blazingly faster* than DOM building.

Stoyan in his jsconf talk warns everyone to reconsider "common myths"
of performance optimization. This is exactly the case here. In fact
Webkit based browsers are generally 3x faster with DOM methods than
with innerHTML.

See: http://www.quirksmode.org/dom/innerhtml.html &
http://jsperf.com/w3c-dom-vs-innerhtml

2010/12/17 Christophe Porteneuve <[email protected]>:
> Hey there,
>
> Well essentially injecting markup is, currently, a snake pit.
>
> If you look into the code for the equivalent features of major frameworks
> (jQuery's html(…), Prototype's update/replace(…), etc.) you'll find that
> they need to implement a number of workarounds depending on the kind of
> markup you're trying to inject.
>
> The main rationale is: whenever non-buggy, use innerHTML as it's going to be
> *blazingly faster* than DOM building.
>
> However, several situations (mostly related to attributes in <a> tags and,
> as always, table-related tags) are improperly handled by innerHTML=
> implementations of a variety of browsers (generally IE), so manual DOM
> building is required.
>
> Ironing out this sort of discrepancies is exactly the kind of things that
> frameworks should do for you, as a "common ground".
>
> --
> Christophe Porteneuve
> [email protected]
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to