[thelist] AJAX Tip

kasimir-k evolt at kasimir-k.fi
Thu Apr 6 09:33:00 CDT 2006

>>> innerHTML
>> is often faster than the DOM way.

Christian Heilmann scribeva in 06/04/2006 14:11:
> Arguably. It is dead handy for debugging and also for writing out a
> bunch of HTML you got from  an XHR.

This is actually pretty much the only situation where I use it.

> For generating HTML it is not as clever though,

Clever - no. Fast - yes. If I happen to end up with a table with 
hundreds of rows, and must manipulate it client side, I just might rely 
on innerHTML. (Naturally heavy tasks are often better done server side, 
but sometimes that is not an option.)

> This also promotes the idea of HTML as a node tree, and not as a huge string.

And this is a very worthwhile idea to promote too!

And as you mentioned XHR (and as the title of this thread has "AJAX" in 
it :-) this is good place to tell, that the XMLHttpRequest object is now 
a W3C Working Draft: http://www.w3.org/TR/XMLHttpRequest/


More information about the thelist mailing list