close all windows from one place - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

close all windows from one place

ampoampo Posts: 63Member
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.

Comments

  • WeirdofreakWeirdofreak Posts: 439Member
    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)
  • ampoampo Posts: 63Member
    : 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 ???
  • WeirdofreakWeirdofreak Posts: 439Member
    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.
Sign In or Register to comment.