Hi All,
I am trying to dynamically replace a table in the dom, anyone have an
idea on how to do this.
here is some sample suedo code of what I want to do.
var tableHTML = "<table id=\"table1\">< tr><td>this is table 1</td></
tr></table>";
var tableHTML2 = "<table id=\"table2\">< tr><td>this is table 2</td></
tr></table>";
vat t1 = document.getEle mentById("table 1");
if (t1)
{
t1 = tableHTML2;
}
I am sure that assignment is not right, its needs to be something like
t1.outerXml = tableHTML2;
or
t1.parentNode.i nnerHTML = tableHTML2; /// this could kill anything
else in the node though.
Any ideas on how to do this?
Thanks,
-SJ
I am trying to dynamically replace a table in the dom, anyone have an
idea on how to do this.
here is some sample suedo code of what I want to do.
var tableHTML = "<table id=\"table1\">< tr><td>this is table 1</td></
tr></table>";
var tableHTML2 = "<table id=\"table2\">< tr><td>this is table 2</td></
tr></table>";
vat t1 = document.getEle mentById("table 1");
if (t1)
{
t1 = tableHTML2;
}
I am sure that assignment is not right, its needs to be something like
t1.outerXml = tableHTML2;
or
t1.parentNode.i nnerHTML = tableHTML2; /// this could kill anything
else in the node though.
Any ideas on how to do this?
Thanks,
-SJ
Comment