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

Q1027 How can I change the current location and open a popup window at the same time?

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

Try:

<A HREF="nextpage.htm" onClick="window.open('popup.htm','','width=400,height=400')">text link</A>

Although there maybe a timing issue, where the changing of the current location stops the popup from being loaded.

It might be better to use something like:

<SCRIPT LANGUAGE="JavaScript"><!--
var wheretogo = '';
function go(ur1,url2) {
    wheretogo = url1;
    setTimeout('location.href = wheretogo',2000); // 2 second delay
    window.open(url2,'',width=400,height=400');
    return false;
}
//--></SCRIPT>

<A HREF="nextpage.htm" onClick="return go('nextpage.htm','popup.htm')">text link</A>

Feedback on 'Q1027 How can I change the current location and open a popup window at the same time?'

©2018 Martin Webb