mns
mns

Reputation: 683

Refreshing parent window after closing the popup

I have a condition by which I need to refresh the parent window after closing the child window.

For example:

Suppose A.aspx is the page from which I am opening a popup (B.aspx). When I close B.aspx page it should reload my A.aspx.

Note: I am using window.open()

Upvotes: 2

Views: 575

Answers (1)

Rodrigo Siqueira
Rodrigo Siqueira

Reputation: 1154

You can control main window in your popup by using window.opener

window.addEventListener('beforeunload', function(eventObject) {
   window.opener.location.reload(); 
});

Upvotes: 2

Related Questions