Click to See Complete Forum and Search --> : closing stuff!


SearedIce
01-18-2003, 01:44 PM
ok...i have made my page open a remote window...it opens the other window as an html file...like...ok

how can i make the main window close the remote window, knowing the remote window's "name"...?

~John

khalidali63
01-18-2003, 01:57 PM
just use the following format

popupWindowName.close();

this should it for you.

cheers

Khalid

SearedIce
01-18-2003, 02:29 PM
the problem is that the name of the window is a variable...

khalidali63
01-18-2003, 02:33 PM
thats not a problem,thats preciesly how one would achieve this.

var newWin = window.open()

and then call this from anywhere you want

newWin.close();
please keep in mind the scope rules of a variable

Khalid

SearedIce
01-18-2003, 02:43 PM
i'll explain more...

i have a function...
the function has a for loop...
the for loop opens 3 windows, and makes the window's name the value of the for loop's variable as it opens the window

thus, 3 windows pop up with the names "1" "2" and "3"

...now...i have it wait two seconds after that loop with a settimeout

then, i have another for loop that (should) close the 3 windows

i'm trying to make that for loop that does the closing close each window by the loop's variable's value...thus it closes window "1", then "2", and finnally "3"

khalidali63
01-18-2003, 03:05 PM
try the zipped solution,
hope this helps

cheers

Khalid

SearedIce
01-18-2003, 07:49 PM
gee...your idea seems to be what i need...i hafta get off right now and don't have enough time to play with it/ see if it is really what i want but it looks like it is

um...can i change around stuff and give you credit in the source for helping and it mostly being yours?