editing the dom of a webpage from an iframe?

Y

yawnmoth

Say page A included an iframe to page B and that I wanted page B to
modify page A's DOM. How might I go about doing this?

opener.document.* works for popup windows.... might it work for
iframes, as well?
 
M

Martin Honnen

yawnmoth said:
Say page A included an iframe to page B and that I wanted page B to
modify page A's DOM. How might I go about doing this?

If B is in a frame then
parent
will give you the parent window
parent.document
the document object in the parent window.

If someone loads your page B into a browser window of its own then
parent is the same as window i.e.
parent === window
 
T

Tom Cole

Martin did, but not yawnmouth...

yawnmouth said "iframe", Martin read "frame". So I thought it was
relevant.
 
R

Richard Cornford

Tom said:
Martin did, but not yawnmouth...

Did what? Please do not top-post to comp.lang.javascript.
yawnmouth said "iframe", Martin read "frame". So I thought
it was relevant.
<snip>

When the tree-like hierarchy of frames is being navigated (through the -
frames - collection, the - top - and - parent - properties of the
window/frame/global objects involved) the distinction between "frame"
and "iframe" is non-existent.

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top