demo.htm<script language=javascript>
var newWindow;
newWindow = window.open("2.htm","","width=200;height=300");
</script>
<input type=button onclick="addRow(1)" value="addRow">
<script>
function addRow(s)
{
var tr1 = newWindow.dTable.insertRow(s)
var td1 = tr1.insertCell();
td1.innerText = "Cell1";
var td2 = tr1.insertCell();
td2.innerText = "Cell2"
}
</script>
2.htm<table id="dTable" name="dTable">
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
var newWindow;
newWindow = window.open("2.htm","","width=200;height=300");
</script>
<input type=button onclick="addRow(1)" value="addRow">
<script>
function addRow(s)
{
var tr1 = newWindow.dTable.insertRow(s)
var td1 = tr1.insertCell();
td1.innerText = "Cell1";
var td2 = tr1.insertCell();
td2.innerText = "Cell2"
}
</script>
2.htm<table id="dTable" name="dTable">
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
newWindow.dTable是,有时候正确,有时候告诉我,
newWindow.dTable为空或不是对象.
还是谢谢wanghr100(灰豆宝宝.net)