I found a large number of browser-side JavaScript templates that display a template with data values. However, I'm a little unsure how this line should be translated to display elements in the DOM.
Obviously, one way is just document.write - but I think it has been buried since then.
Another uses element.innerHTML, but at least a few years ago it was not part of any standard and it did not work for XHTML documents.
So what is the deal these days? Is .innerHTML usable and works fine for XHTML and is part of the standard? Or do people just use it and it works? Or is there something else that is supported?
As an aside, PURE.js seems to be all about creating templates from DOM elements, which seems very attractive to me - are there other template engines that work the same way?
source
share