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

Q184 Is there a way to set the base target for a frame to parent.opener?

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

Q184 Is there a way to set the base target for a frame to parent.opener?

If you want to target everything into the parent then:

<html>
<head>
<base target="_parent">
</head>

<body>
<a href="apage.html">load into parent</a>
</body>
</html>

If you want to target everything into the opener of the parent, say the window was opened by another window then you'll need to provide the opener window with a name. The main window has no name by default.

In the original window:

<script language="JavaScript"><!--
if (document.images)
    window.name = "myWindow";
//--></script>

Note, in Netscape Navigator 2 and/or Internet Explorer 3 as the windows name property was read only. It has since been made a read/write property. Therefore the check for images support is used as a simple browser check.

And then in the popup window:

<html>
<head>
<base target="myWindow">
</head>

<body>
<a href="apage.html">load into parents opener</a></body>
</html>

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.