Hey guys, I'm using Ajax on a site I'm developing to eliminate having to travel to a bunch of different pages to perform pretty simple functions. I'm having an issue getting a table to display a new row, with the following code:
The code is "working," in that the table border is set and the alert shows up at the end, but the additional row never shows up. Is there something I'm missing?
Code:
if(xmlHttp.readyState==4)
{
alert(xmlHttp.responseText);
overlay();
var table = document.getElementById('topfive');
var newRow = document.createElement('tr');
var newData = document.createElement('td');
var dataText = document.createTextNode('Worked!');
newData.appendChild(dataText);
newRow.appendChild(newData);
if (newRow == null)
alert('NewRow == null');
if (newData == null)
alert('NewData == null');
table.appendChild(newRow);
table.setAttribute("border", "2");
alert('Should be done.');
}
The code is "working," in that the table border is set and the alert shows up at the end, but the additional row never shows up. Is there something I'm missing?