/    Sign up×
Community /Pin to ProfileBookmark

page reload on closing popup

hello!

I have one parent page parent.php with links to many popups where the user changes parameters and closes them to return to the parent page.

How can I refresh automaticaly this parent page after the popup hase been closed ?

Thanks in advance
Bob

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Aug 22.2006 — How about:

onunload="window.opener.location.reload();"

Eric
Copy linkTweet thisAlerts:
@gil_davisAug 22.2006 — In the popup:
<i>
</i>window.onbeforeunload = function () {window.opener.history.go(0);}

but be careful!
Copy linkTweet thisAlerts:
@bob777authorAug 22.2006 — putting onunload="window.opener.location.reload();" to popup body doesnot refreshes the parent window, may be i must name the windows or the link to the popup must be other than simple href target blank ?
Copy linkTweet thisAlerts:
@A1ien51Aug 22.2006 — If JavaScript does not open the window, than you do not have access to it.

Eric
Copy linkTweet thisAlerts:
@bob777authorAug 22.2006 — ok my parent code :

<a href="dates_simul.php?id=<? echo $id; ?>&action=none" onclick="NewWindow(this.href,'mywin','500','500','yes','center');return false" onfocus="this.blur()">Choix des dates de recapitulatif</a>

and in popup :

<body onunload="window.opener.location.reload();">

doesnot work , i've missed something ? Name= ?

Thanks
Copy linkTweet thisAlerts:
@gil_davisAug 22.2006 — Did you try my suggestion with history.go(0)? I tested it in IE6 XP SP2, and it works. My window is not named.
Copy linkTweet thisAlerts:
@bob777authorAug 22.2006 — thanks everybody, the sol :


<script>

function Close() {


opener.location.reload(true);

opener.focus();

self.close();

}

function HandleOnClose() {

if (event.clientY < 0) {

event.returnValue = '';

Close();

}

}

</script>

</head>

<body onbeforeunload="HandleOnClose()">

...

<input type=button onclick="Close();" value="Quitter [X]">


So that onclick or on window close i have the job done - the pop is closed and the parent refereshed

will see in firefox
×

Success!

Help @bob777 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 5.30,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...