Some random thoughts…
- Tim Bray is on to something when he talks about Ajax’s real upside.
- You can only get so far by glueing strings together.
- DOM manipulation is unwieldy.
My own preference is to use a template system that lets you insert snippets of the host language code. [for the record I'm fully aware that this isn't considered "best practice"] .
So this post is a roundabout way of launching SXOOP.template.
A little background on SXOOP.template…
I started out by writing my own template system using DOM manipulation and cloneNode() . The code got HUGE quickly (500+ lines) and because I soon discovered that cloneNode is fundamentally broken in IE (It’s kind of selective about which nodes it clones), I eventually gave up that approach.
Then I discovered TrimPath’s template system which is pretty nifty (and has a small codebase too: less than 400 lines of code !). I used TrimPath for a while but while I was working on the Poor-Man’s Blog example, I ran into a problem – TrimPath doesn’t like XML namespaces. I contacted the TrimPath guys but heard nothing back.
I’ve tested this on Internet Explorer, Safari and Firefox. YMMV.