Rob Gonda's Blog

DOM Vs. innerHTML

There is quite a debate when using Ajax/DHTML on whether to use DOM nodes or innerHTML. I've been a follower of innerHTML, not only because it's easier, not only because you reuse the same view layer, but now also because it's indisputably faster.

When using an MVC architecture, it's easier to reuse partial UI's by rendering them as usual and injecting them into the page using innerHTML. That has been the philosophy of Rails, and mine when coding any Model-Glue / MachII project using Ajax.

Check out this benchmark and see for yourself...

TrackBacks
There are no trackbacks for this entry.

Trackback URL for this entry:
http://www.robgonda.com/blog/trackback.cfm?725916E5-3048-7431-E41F5AD4E64376A5

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
This blog is running version 5.9.003. Contact Blog Owner