471,852 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

Modify a table in a parent window froma child

I'm having problems changing a table from a child window.

What works (but I really want to add more complex objects to teh cells
not just plain text)

var myTable = self.opener.document.getElementById("MY_TABLE");

var row = myTable.insertRow();
var cell = row.insertCell();
cell.innerText = "New value";

I've tried the two below methods but they both fail.

var myTable = self.opener.document.getElementById("MY_TABLE");
var row = myTable.insertRow();
var cell = row.insertCell();
cell.appendChild(self.opener.document.createTextNo de("New Value")); <--
Gives me an error of "Invalid arguement"

I've also tried

cell.appendChild(document.createTextNode("New Value")); <-- Gives an
error of "No such interface supported"

Any ideas?
Thanks
Eric

Feb 2 '06 #1
1 1258
Wescotte wrote:
I'm having problems changing a table from a child window.
[...]


HTMLTableRowElement object should/must be appended as children of
HTMLTableSectionElement objects, and the element objects have to be
created in the same DOM context they should be appended to.

`(window.)self' is as proprietary as `window' is and refers to the
same object.
HTH

PointedEars
Feb 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by jp.delatorre | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.