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

Q1771 How can you force the current window to close after opening a popup window?

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

All you have to is type 'force' in the brackets e.g. setTimeout('self.close(force)',2000);

<SCRIPT LANGUAGE="JavaScript"><!--
if (window.name != 'mainIndex') {
    var width = 640,height = 480;
    if (window.screen) {
        width = screen.availWidth;
        height = screen.availHeight;
    }
    window.open('index.htm','mainIndex','width=' + width + ',height=' + height + ',screenX=0,screenY=0,top=0,left=0');
    setTimeout('self.close(force)',2000);
}
//--></SCRIPT>

Submitted by Stuart Holroyd

©2018 Martin Webb