469,336 Members | 5,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

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 1210
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
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.