Use Only One Popup

[Total: 0    Average: 0/5]

This code will open up popups all the same window.

Body Code:

var _start="<HTML><HEAD><TITLE>My Page</TITLE></HEAD><BODY onunload='opener._win=null;'>";
var _end="</BODY></HTML>";
var _page=new Array();
    _page[1]=_start+"One is a lonely number."+_end;
    _page[2]=_start+"Two is a nice pair"+_end;
    _page[3]=_start+"Three often leaves out one - isn't that lonely"+_end;
var _win=null;
function closeWin()
  if(_win && !_win.closed &&
function openWin(i)

<a href=javascript:openWin(1)>click to open window #1</a><BR>
<a href=javascript:openWin(2)>click to open window #2</a><BR>
<a href=javascript:openWin(3)>click to open window #3</a><BR>

the code that follows is here only to show what needs to be in the body tag
&lt;body onload=closeWin() onfocus=closeWin()&gt;

Times Viewed: 7

Leave a Reply

Your email address will not be published. Required fields are marked *