2 ms·
It Depends. If you're doing something really simple where you know exactly what the HTML you're slotting in to the DOM is going to look like, go with AHAH - it'
by simonw 18y ago
It Depends. If you're doing something really simple where you know exactly what the HTML you're slotting in to the DOM is going to look like, go with AHAH - it's generally easier to generate HTML snippets on the server-side than the client-side due to JavaScript's poor support for multi-line strings.
If you're likely to want to re-use the data service you're building in more than one place, go with JSON. The problem with an AHAH endpoint is that it can only be used for one thing - a JSON endpoint can easily be repurposed for other parts of your application.
The only reason to bother with XML is if you're going to be doing HUGE transforms of e.g. a ton of data in to an HTML table, at which point you might want to use client-side XSLT for a speed boost. The vast majority of applications won't need that though, in which case JSON is far more convenient.