Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.