Re:Two techniques for massively faster JavaScript
by willwagner on Monday April 27, 2009 @01:27PM
(#581667)
I see your point; I misread it first time around. From a security point of view for user content, nodeValue is a much better approach.
(My example code shows some HTML code as plain text, which needs htmlEntities when using innerHTML).
You can't put anything in nodeValue apart from a string value. But the good thing is, it's just a string. No security issues, no entity encoding, no html tag issues.