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

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

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

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

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


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.