You are here: irt.org | FAQ | JavaScript | Window | Q648 [ previous next ]
Try:
<SCRIPT LANGUAGE="JavaScript"><!--
function doit() {
opener.otherWindowName.close();
opener.location.href = 'anotherpage.htm';
}
//--></SCRIPT>
<A HREF="javascript:doit()">...</A>This works if you've opened your two windows using:
<SCRIPT LANGUAGE="JavaScript"><!--
windowName = window.open('firstpage.htm'); // the one doing the closing
if (!windowName.opener)
windowName.opener = self;
otherWindowName = window.open('secondpage.htm'); // the one being closed
//--></SCRIPT>