Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 912571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:24:18+00:00 2026-05-15T17:24:18+00:00

I’m opening a named window by using window.open function: win = window.open(xxx.html, mywin); After

  • 0

I’m opening a named window by using window.open function:

win = window.open("xxx.html", "mywin");

After that I move to another page from the parent window, and I want to decide whether the window named “mywin” is still open or not.

If I was in the parent page, I would use win.closed, but since I changed the page, I lost the reference. How can I get it back? 🙂

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:24:19+00:00Added an answer on May 15, 2026 at 5:24 pm

    I can think of two possible ways that might be worth trying…

    Firstly, you could approach this by letting the child window talk to the parent window rather than the parent to the child. Whilst the parent window will lose the reference to the child when the page transitions the child should still be able to get back to the new page (as long as it is still on the same domain) via window.opener. The child could use set interval to access the opening window and set a ‘still open’ status. You would have to code it in such a way as to be able to handle not having a document during the transition load but it would work. Code would be roughly as below but you could refine this by handling the load and unload events of the parent by the child and only running the timer between transitions.

    Parent Window (all pages)

    var childStatus = "unknown";
    

    Child Window

    var timerHandler;
    
    funciton ChildCallBack()
    {
      try
      {
        window.opener.childStatus = "open";
      }
      catch(e)
      {
      }
    }
    
    timerHandler = window.setInterval(ChildCallBack, 100);
    
    function window_onclose()
    {
      try
      { 
        window.clearInterval(timerHandler);
        window.opener.childStatus = "closed";
      }
      catch(e)
      {
      }
    }
    
    window.onclose = window_onclose;
    

    Secondly, and ideally as a last resort, the other, quite horrible, alternative is to use an iframe. Place your transitioning page within an iframe so the actual main page doesn’t change and so can maintain a reference to the child. The iframe could be sufficiently large as to appear like a full page. It is a nasty hack like solution but should also work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 448k
  • Answers 448k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here's a very basic example of what you're trying to… May 15, 2026 at 8:03 pm
  • Editorial Team
    Editorial Team added an answer Looks like the main.moc file hasn't be generated. Try this:… May 15, 2026 at 8:03 pm
  • Editorial Team
    Editorial Team added an answer Nope. All you need to do is set to build… May 15, 2026 at 8:03 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.