The big problem with innerHTML is that most people are very lazy when
they use it, and end up not escaping things properly... I generally
consider innerHTML to be an optimization for the cases that warrant
it, not a design goal.
On Dec 5, 2005, at 2:14 PM, Alex Russell wrote:
> Under the covers, dojo uses innerHTML (or whatever else is available
> that does the same thing) to deserialize the content of a template,
> which is then cloneNode()-ed for each new widget instance. We haven't
> addressed the templating problem yet, but I expect our approach to
> expose only DOM and to be conservative about maintaining node
> references, no matter what it does under the covers.
> On Monday 05 December 2005 1:41 pm, Max Demian wrote:
>> Anyone have a link (or some thoughts) on innerHTML vs DOM
>> I've got to make a decision for a project here and I'm not sure what
>> current best practice is considered to be.
>> (the data is coming in from the server in JSON, so innerhtml without
>> some kind of js templating is not going to happen).
>> My gut tells me DOM is the "right" way to do things, but i've seen
>> plenty of benchmarks that show innerHTML is much much faster (order
>> of magnitude faster at least) even with heavy use of cloneNode.
>> What does dojo favour? As i'm using more and more dojo code and will
>> likely be really getting inside the dojo code as this project
>> progresses I should probably go the way dojo has gone.
>> Jesse Sherlock
> Alex Russell
> [hidden email] BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
> [hidden email] F687 1964 1EF6 453E 9BD0 5148 A15D 1D43 AB92 9A46
> Dojo-interest mailing list
> [hidden email] > http://dojotoolkit.org/mailman/listinfo/dojo-interest