Page 1 of 1

Javascript: On function close all windows

Posted: Wed Jun 14, 2006 3:12 am
by tecktalkcm0391
I wanted to make a function that would close all windows (it created) starting with window. How would I do something like this. Just some clues/hints would be awsome, but you could make it easy and give me some code! :wink: :wink: :wink: <-- Yeah I know what your all going to say, Giving code doesn't help the person.... well believe it or not as long as there is a explaination, ppl learn, well at least I do cause then when I need something like it again I go back to that code and figure out how change... and there is were ppl learn!

^
^
^
Sorry about that.

Posted: Wed Jun 14, 2006 3:31 am
by CoderGoblin
Don't have the code but you should keep track of all the windows you open in an array. Then loop through the array and close them.

As another alternative...
window.open has an option "dependant". When you close the parent window all dependant windows close. Maybe you could use this...

Posted: Wed Jun 14, 2006 4:58 pm
by tecktalkcm0391
How would I do the array thing, and/or the window.open thing

Posted: Wed Jun 14, 2006 5:35 pm
by feyd
tecktalkcm0391 wrote:How would I do the array thing, and/or the window.open thing
By reading how the basics of Javascript work and by reading the link he gave you, respectively.

Posted: Sat Jun 17, 2006 12:11 am
by tecktalkcm0391
I am getting a book for Javascript, and I don't know how I didn't see his link!

Posted: Sat Jun 17, 2006 12:14 am
by tecktalkcm0391
CoderGoblin wrote:Don't have the code but you should keep track of all the windows you open in an array. Then loop through the array and close them.

As another alternative...
window.open has an option "dependant". When you close the parent window all dependant windows close. Maybe you could use this...
Thanks I'll def. use the dependant variable.