[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help w/ Closing a Target window

Sonja Aagesen (Starwave) wrote:
> Hi,
> After spawning another window which loads at start;
> <Body onLoad=window.open("blah.html","Test" , "width=200,length=400")>
> I would like to close that window ("Test") when the user leaves my
> site. Iv'e tried putting onUnload=("","Test") in the <body> tag, but
> all it seems to do is close the current/active window.
> Does anyone know if there is a way to do this?
> Thanks for the insight
> Sonja
> sonja@oz.net
> sonjaa@starwave.com
> ps.  the site isn't up cuz some of the parts aren't working

I'll tell you if you get me a job at Starwave... :)
Anyways, the way I've found to do it is to make a function in your 
<HEAD> that open your other window using a variable:

function windowOpen(){
   newWindow=window.open("blah.html" , "Test" , ...);

use the onLoad="windowOpen()" then you can close the new window with 
unLoad like this

onUnload "newWindow.close()"

You get the idea, I don't have the docs in front of me so I hope I 
remembered all the quotes and stuff. This should get you atarted. 
Good Luck.

Gordon Mueller