Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

A little JavaScript Windows help please...

  • 05-04-2002 01:56PM
    #1
    Moderators, Social & Fun Moderators Posts: 28,633 Mod ✭✭✭✭


    My parent windows fires off a popup child - no worries.
    The parent window then does a reload - again, no worries.
    Now I'm looking to close the popup after the parent finishes reloading.
    I'm guessing something along the lines of window.childname.close() but is it
    best to do a function that, when the parent loads, it checks if there's any
    windows open with that name (it'll always be the same name) and close them
    or is there a more precise way of doing it?


Comments

  • Moderators, Social & Fun Moderators Posts: 28,633 Mod ✭✭✭✭Shiminay


    Got it! I have a function that fires when the page loads which looks for any windows with the name of my popup and closes them:
    function killWin(){
      window.open("",winName); // no url, but you're supplying the name
      window.close();
      }
    
    It's seems so bloody simple now! :)


Advertisement