Forum Moderators: open
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 :
OnClick=window.open
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 :
javascript:window.close()
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
jerome.
opener.reload()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();
window.close();
}