DOMBuilder

Categories: uncategorized

Date: 31 July 2006 22:45:26

A few months ago I asked the question whether it was possible for some Javascript to parse through a piece of HTML and render it all out using the "proper" DOM methods rather than the sledgehammer-to-crack-a-nut manner of innerHTML. The great Stuart Langridge commented that this woul open up a huge can of worms in case people put non-standard code into it. I agree.

Well, it seems there's a way to do this from the other side, if you know what I mean. The clever chaps (and chapess) at Vivabit came up with this clever DOMBuilder script that allows you to build snippets of HTML code using the DOM in an almost-easy manner. Well, it's certainly easier that createElement-ing and appendChild-ing everything.

And it's also another neat use of the Javascript Object Notation thingamajig. Clever.