Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Frame | Q184 [ previous next ]

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>

©2018 Martin Webb