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 6962575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:40:42+00:00 2026-05-27T15:40:42+00:00

The child lost its parent!! I have a parent window, when somebody clicks on

  • 0

The child lost its parent!!

I have a parent window, when somebody clicks on an image a JS popup opens and displays the photo and its information.

To close the popup/child window, and to flash an element on my parent/opener window, I have been using this function:

function closeWindow() {
    var currentID = document.getElementById('currentID').value;
    window.opener.flashElement(currentID);
    window.close(); 
}

My problem is this doesn’t work if my users navigate away from the page that the popup originally opened. For example, in the popup window, there are next and previous buttons to scroll through the individual photos in that set of results, which reloads the page with a new querystring value.

If my user scrolls (reloads page) less than 7 times it’s okay but if they scroll more than that, the window.opener function does not work, and because of that, the window.close function doesn’t either!

I could probably rebuild the page so the data comes via an AJAX call, rather than reloading the page, but that’s a lot of work I could do without.

Any ideas?

  • 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-27T15:40:43+00:00Added an answer on May 27, 2026 at 3:40 pm

    My guess is that

    window.opener.flashElement(currentID);
    

    is throwing an error, or the function does not exist. Most likely the element with the value of currentID does not exist on the page. Try catching the error.

    function closeWindow() {
        var currentID = document.getElementById('currentID').value;
        try {
            window.opener.flashElement(currentID);
        } catch (err) {
            alert(err.description || err) //or console.log or however you debug
        }
        window.close(); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my child window I have $('#opfile').addOption(someval,sometext); Problem is #opfile is an a parent
When you have parent-child tables and you wish to use a DetailsView to edit
I've currently got custom control that has somehow lost its parent and is now
Child and descendant selectors have been leaking to every element on my html structure
//child process char buf[20]; read(fd[0][0], buf, 20); printf(%s, buf); //parent process write(fd[0][1], 12, 20);
I'm creating child processes with fork() in C/C++. When the parent process ends (or
I have a child form that is throwing an ApplicationException in the Load event
I have a project where I'm loading relative image Uri's from an xml file.
Supposing these are my parent and my child objects: Parent: @Entity @Table( name =
Have textarea wrapped in parent div element. This textarea becomes visible only when parent

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.