Re:Stop sending template engines to the browser. How to make...
by mmahemoff on Thursday September 13, 2012 @09:21PM
(#4519555)
This can work, it's just a slightly more complex programming model, as it couples the template population code with the DOM structure. Whereas a template is effectively a cleanly-defined API in which you just pass it a set of key-value pairs.
DOM manipulation has traditionally been slower than innerHTML, which is another reason people might have shied away from this approach. I believe the performance gap is no longer clearcut though, so the argument may not hold for recent browsers at least.
DOM manipulation has traditionally been slower than innerHTML, which is another reason people might have shied away from this approach. I believe the performance gap is no longer clearcut though, so the argument may not hold for recent browsers at least.