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

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

You are here: irt.org | FAQ | JavaScript | Window | Q213 [ previous next ]

<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?'

©2018 Martin Webb