Hello,
I am working with an old Java Script code and have found the following
but after putting in alerts I have found that insertRow doesn't work.
What is the problem?
TIA
function addRowDOM (tableID) {
// pass every cell content as a futher arg
alert("here");
var table =
document.all ? document.all[tableID] :
document.getEle mentById(tableI D);
alert("here 2");
if (arguments.leng th > 1) {
alert(table.row s.length);
var row = table.insertRow (table.rows.len gth);
alert("after var");
if (document.all) {
alert("second if");
for (var i = 1; i < arguments.lengt h; i++) {
alert("in the for loop");
var cell = row.insertCell( i - 1);
cell.innerHTML = arguments[i];
}
}
}
I am working with an old Java Script code and have found the following
but after putting in alerts I have found that insertRow doesn't work.
What is the problem?
TIA
function addRowDOM (tableID) {
// pass every cell content as a futher arg
alert("here");
var table =
document.all ? document.all[tableID] :
document.getEle mentById(tableI D);
alert("here 2");
if (arguments.leng th > 1) {
alert(table.row s.length);
var row = table.insertRow (table.rows.len gth);
alert("after var");
if (document.all) {
alert("second if");
for (var i = 1; i < arguments.lengt h; i++) {
alert("in the for loop");
var cell = row.insertCell( i - 1);
cell.innerHTML = arguments[i];
}
}
}
Comment