Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: SV: Re: Closing a window


Message #1 by "Robert Nyman" <robert.nyman@c...> on Sat, 21 Dec 2002 23:16:32 +0100
if(typeof windowName =3D=3D "object")

or

try{
	windowName.close();
}
catch(e){

}

or

try{
	closeWin =3D setInterval("windowName.close()",1);
}
catch(e){

}

or this for older browsers such as Netscape 4:

window.onerror =3D function (){
	return true;
}
closeWin =3D setInterval("windowName.close()",1);


But when it comes to advertising pop-ups through your ISP,
how do you know the name of the window?


Good luck!


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: Trent Blackburn [mailto:puzzlepants@m...]
Skickat: den 21 december 2002 15:57
Till: JavaScript HowTo
=C4mne: [javascript_howto] Re: Closing a window


I can't use windowname.close until the window is open, and that is the
problem. I want to use windowname.close right when the window opens.
Also, if I use an interval like:

variable =3D setInterval("windowName.close()",1)

That would generate errors until the popup opens. The popup doesn't
always open as well, and that's why I want to know if there is a
windowName.onopen function that I could use.



  Return to Index