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

Q1330 Is there any way that I can close all the child windows just by clicking one button?

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

Use an array:

<script language="JavaScript"><!--
openWins = new Array();
curWin = 0;

function openWin(page) { openWins[curWin++] = window.open(page,'_blank'); }

function closeAll() {
    for(i=0; i<openWins.length; i++) if (openWins[i] && !openWins[i].closed) openWins[i].close();
}
//--></script>

Feedback on 'Q1330 Is there any way that I can close all the child windows just by clicking one button?'

©2018 Martin Webb