The speed of innerHTML depends ONLY on the DOM implementation and not on
the js code at all. If some browsers perform better when you call
el.innerHTML='' than .createElement()& el.appendChild() then it must be
considered a bug or at least crappy engine of the browser itself. I have
experienced such problems with the Galeon browser where you can see 3x
time speed acceleration when using .innderHTML instead of creating each
node. But once again: this is browser bug or poor DOM manipulation issue.
Anyway if the targeted browser supports innerText you will*REALLY* see
a performance peak.
My personal opinion is that manually creating elements is a better
practice since it makes further manipulation much easier. The only issue
here is when using some js library like JQuery (just watch the number of
function calls in the profiler when u call $('<div></div>') and you may
go crazy :)
PS: This topic is getting REALLY hard to follow due to the reply style
--
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]