faqts : Computers : Programming : Languages : JavaScript : Links

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 16 people (75%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

how can I close a window which create by a link using target=new? Can we close all windows cascade down all children created by links?

May 1st, 2001 14:03
Colin Fraser, Frank Luo,


This should work, but it is untested :
<script language="JavaScript"><!--
opWindows = new Array();
currWindow = 0;
 function openWindows(page) {
    opWindows[curWin++] = window.open(page,'_blank'); }
 function closeWindows() {
     for(i=0; i<opWindows.length; i++)
	 if (opWindows[i] && !opWindows[i].closed)
		opWindows[i].close();
 }
 //--></script>