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

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

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

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

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


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.