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

Q959 How can I open a second popup window, and close the first popup window?

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

Try:

<script language="JavaScript"><!--
var windowHandler1 = windowHandle2 = '';

windowHandle1=window.open('http://www.irt.org/')
if (!windowHandle1.opener)
    windowHandle1.opener = self;

function open2ndWindow() {
    windowHandle2=window.open('http://www.irt.org/script/faq.htm')
    if (!windowHandle2.opener)
        windowHandle2.opener = self;
    windowHandle2.close();
}
//--></script>

<form>
<input type="button" value="Open 2nd" onClick="open2ndWindow()">
</form>

©2018 Martin Webb