Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Refreshing a page when closing a popup

Close the popup and the page that opened it refreshes

10:37 am on Jul 28, 2008 (gmt 0)

New User

10+ Year Member

joined:Jan 6, 2008
posts: 32
votes: 0

Hi JSers !

I don't know much, if anything, in Javascript but I'm facing a problem I'm sure JS could solve. I have a page with a link that, when clicked, opens a popup with :


Now, that popup performs its action and ends. The popup stays there and now offers a link to click in order to close it with :


What I'd want to do is to send a "message", or some sort of trigger from the popup to the main page so that when the popup closes, the main page that called it refreshes itself.

Can Javascript do that ? And if yes, how would you go about it ?

Thanks for your help


10:23 am on July 30, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:May 4, 2004
votes: 0

On the first instance i'd sugest to try
from the popup, but the decent solution is to make a callback function on the main window (say myReload()), which only reloads the page itself. Within the popup you can make a function like below, and call this function whenever you want to close that window.

function closeMe() {
if (opener && opener.myReload) opener.myReload();