There are two ways of doing this:
You can build the html on the server or you can build an XML document on the server and have the JavaScript build the html code.
Either way works. Some people perfer to use the server side to do it since they do not know JavaScript. Others perfer JavaScript since you can use DOM to build the elements.
The difference between builing the two methods are.
Building the html code, you need to use the responseText property of the XMLHttpRequest Object. With XML, we want to use the responseXML property.
If you return a document that is not XML, then you can not use JavaScript XML DOM methods to access the elements.
Some people sayy building the HTML on the server eliminates the extra looping on the client. It is true and I work with book concepts in my book AJAX in Action. I know you can not wait to November to see the code so look here:
http://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples I am also trying to put together an example on my blog with a server interaction that works with a timeout.
Eric