View Full Version : Can't display a table row via Ajax

07-31-2011, 07:08 PM
I'm trying to click on a link and via Ajax, get a table row to display updated data. I have it all working except it displays at the top of the table instead of inside the table at the desired row.

For now, I'm just trying to add a simple table row using:


Here is my table code:

<span id="id_row3"></span>

So when I click on my link to execute the ajax code, I expect to see a table row inserted with the text "four" but "four" displays at the top of the web page, above the table itself. How can I get the new row to insert at the id_row3 tag?

Thanks for any help...

07-31-2011, 09:09 PM
1. Get rid off the span ... it is not allowed like this inside a table

var newTR = document.createElement('tr');
var newTD = document.createElement('td');
var newText = document.createTextNode('test');