View Full Version : Count the popup windows from main window

09-26-2003, 01:42 PM
Is there any way we can count the number of popup windows opened from a main(opener) page?
The popup windows will be opened from the main page using window.open. I want to make sure that only one pop up is open from this main page.

09-26-2003, 02:03 PM
why not just open the popups in the same target name

function doOpen(url){
var w = window.open(url,'myOnlyPopup','width=800,height=600');
return false;
<a href="popup1.htm" target="myOnlyPopup" onclick="return doOpen(this.href)">Popup#1</a>

<a href="popup2.htm" target="myOnlyPopup" onclick="return doOpen(this.href)">Popup#2</a>

<a href="popup3.htm" target="myOnlyPopup" onclick="return doOpen(this.href)">Popup#3</a>

That will open popups in the window named 'myOnlyPopup'