JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
close all windows from one place Posted by ampo on 13 Apr 2004 at 4:52 AM
Hello.
How can I close all the windows that were open in the application ?
I have a "Log Out" button and I have a window that was open (popup) somewhere in the application. How can I close it ?
Is there some array of the windows names that I can run on and close them all ?

thanks.
Report
Re: close all windows from one place Posted by Weirdofreak on 14 Apr 2004 at 12:37 AM
var popoups = new Array();

Then, instead of just window.opening a popup, do

popups.push(window.open(etc));

And to close them all

for (i = 0; i < popups.length; i++)
popups[i].close;

(Lillu posted this trick a while back, I just stole it)
Report
Re: close all windows from one place Posted by ampo on 14 Apr 2004 at 3:26 AM
: var popoups = new Array();
:
: Then, instead of just window.opening a popup, do
:
: popups.push(window.open(etc));
:
: And to close them all
:
: for (i = 0; i < popups.length; i++)
: popups[i].close;
:
: (Lillu posted this trick a while back, I just stole it)
:


Thanks for the replay.
Not all the popups are open from the same frame.
Is the popups array is global var ???
Report
Re: close all windows from one place Posted by Weirdofreak on 15 Apr 2004 at 12:39 PM
I think it will, if you define the array in the frameset page, but I'm not very good at cross-frame scripting. It probably differs from browser to browser, as well.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.