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

  • SEARCH
  • Home
  • 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 5993575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:41:40+00:00 2026-05-22T23:41:40+00:00

I am opening a popup window with var popup = window.open(‘…’, ‘…’); This javascript

  • 0

I am opening a popup window with

var popup = window.open('...', '...');

This javascript is defined in a control. This control is then used from a web page. I want to reload the page which opens this popup when the popup is closed.

Basically user is required to input some denominations in the popup window and submit. These denominations are then stored in user sessions. And when user clicks submit I am closing the popup window and at the same time want to refresh the window which opens this popup to refetch the updates which user made in the popup.

I am trying to do

var popup = window.open('...','...');
if (popup) {
  popup.onClose = function () { popup.opener.location.reload(); }
}

I guess I am doing it wrong coz this isn’t seems to be working.

For testing the issue I’ve even tried this but no alert appeared.

if (popup) {
  popup.onclose = function() { 
    alert("1.InsideHandler");
    if (opener && !opener.closed) { 
      alert("2.Executed.");
      opener.location.reload(true); 
    } else { 
      alert("3.NotExecuted.");
    }
  }
}
  • 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-22T23:41:41+00:00Added an answer on May 22, 2026 at 11:41 pm

    Here’s what I suggest (updated to newer code)

    in the popup you should have:

    const reloadOpener = () => {
      if (top.opener && !top.opener.closed) {
        try {
          opener.location.reload(1); 
        }
        catch(e) {
        }
        window.close();
      }
    }
    window.addEventListener("unload", () => {
      reloadOpener();
    })
    
    <form action="..." target="hiddenFrame">
    </form>
    <iframe style="width:10px; height:10px; display:none" name="hiddenFrame" src="about:blank"></iframe>
    

    then assuming the same origin, the server process can return

    <script> top.close(); </script>
    

    NOTE: location.reload takes a boolean, add true if you want to not load from cache
    as in opener.location.reload(1);

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

Sidebar

Related Questions

I am opening a popup window from javascript using window.open. I want to open
I'm opening a popup window via javascript. I'm trying to set some of the
I am opening a popup window from X.jsp and the popup is represented by
I am opening a modal popup window. Then I access a parent window textbox
I want to close a popup window from an error page. The process is:
I am opening a new popup window on click of an URL in my
I'm opening a new browser window from my site for some of the members.
My GWT JavaScript app prints reports by opening a new browser window programmatically, filling
I am opening one Popup window on Button Click in main window, it is
I'm opening a modal dialog for IE6 and above using the following javascript. window.showModalDialog(

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.