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

Q213 How can I open a new links window and have the links opening in the main window?

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

Q213 How can I open a new links window and have the links opening in the main window?

<script language="JavaScript"><!--
function linkpage() {
    msgWindow = window.open('','targetname','width=300,height=200');
    msgWindow.location.href = 'mylinks.page';
    if (msgWindow.opener == null) msgWindow.opener = self;
}
//-->/script>

<a href="javascript:linkpage()">Show my links page</a>

And then in the links page:

<script language="JavaScript"><!--
function showlink(url) {
    opener.location.href = url;
}
//--></script>

<a href="javascript:showlink('http://www.somewhere.com/')">Go here</a>

Feedback on 'Q213 How can I open a new links window and have the links opening in the main window?'


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.