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

Q513 How can you target the opener window by name using a normal HTML link?

irt.org | Knowledge Base | JavaScript | Window | Q513 [ previous next ]

Q513 How can you target the opener window by name using a normal HTML link?

The actual main window does not have a name by default, its blank. In the older browsers (Netscape Navigator 2 and Internet Explorer 3) you cannot alter the windows name property as its read only, however in the later browsers (Netscape Navigator 3 and Internet Explorer 4) you can, You can then use the name you've given to the main browser in other windows to target the link. In the main window:

<script language="JavaScript"><!--
if (document.images)
    self.name = 'mainwindow';
//--></script>

Then in the navigation window:

<a href="bpage.html" target="mainwindow">Text Link</a>

There is nothing to actually stop you naming the opener window directly from the popup window:

<a href="bpage.html" target="openerwindow" onClick="if (document.images) opener.name='openerwindow'">Text Link</a>

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.