Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q121 Is it possible to address the frame structure from outside of itself, from an opened child window?

irt.org | Knowledge Base | JavaScript | Frame | Q121 [ previous next ]

Q121 Is it possible to address the frame structure from outside of itself, from an opened child window?

All you need is a reference back to the frame/window that opened the new window.

When opening the window using window.open, the new window is a child of the first window, although the first window is not the parent of the new window.

Make sure the window opening looks something like this:

<SCRIPT LANGUAGE="JavaScript"><!--
// This creates the popup window.
function MakeWindow() {
    myWindow=window.open('','windowName','add you list of properties in here');
    myWindow.href = 'apage.html';
    if (!myWindow.opener) myWindow.opener = self;
}
//--></SCRIPT>

Then you can refer to the opener as opener:

alert(opener.location.href);

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.