/    Sign up×
Community /Pin to ProfileBookmark

Loses parent window on a refresh

This will get very confusing – hopefully i can explain it ok!!

On page 1 if a button is clicked it uses window.open to create a second window (page 2). When page 2 closes it uses window.opener to send information page to the parent window page1.

This is my scenario – if after opening page 2, page 1 is closed and then reopened. The user then clicks the button to open a ‘new’ page 2 but this reloads in the exisitng page 2 window. When the user closes page 2 now i get an error on the window.opener command. It seems to have lost that there is a new parent window.

Can i do anything to fix this? I thought it would get the new parent information once the page was loaded again.

Thanks in advance.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @cause spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...