This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes AJAX and table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "AJAX and table" Watch "AJAX and table" New topic
Author

AJAX and table

Muthukrishnan Manoharan
Ranch Hand

Joined: Aug 27, 2008
Posts: 91

Hi,
I am new to AJAX. Can anyone please help me how to populate a table with data that comes after AJAX request in the form of XML. I mean how to populate the HTML table dynamically from javascript.

Thanks in advance..
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well you have insertRow and insertCell or createElement and appendChild

Loop through the responseXML and use those things I mentioned above.

Eric
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

If you a new and are just practicing, then it would be a lot better if you could change your server side code to return formatted HTML which you could just directly use - with something like document.getelementById("myDiv").innerHTML = response.text().

You might also consider starting with a java script library like Jquery which would save you a lot of hassle which browser compatibility issues.

Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
Yes.If you are new to AJAX then you can go fro DWR.It supports AJAX very well
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60756
    
  65

DWR is interesting, but it imposes a whole different way of working than anyone is used to in JavaScript. I'd not recommend adopting it just for Ajax usage.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AJAX and table
 
Similar Threads
AJAX or AJAX Framework
How to pass xmlresponse to another jsp in struts1.3?
AJAX required or not
Using Java Objects in AJAX??
Extracting values from JSTL forEach