I am trying to have the user sign in through a popup window. When they click the link to the popup window which is a php variable they can sign in. When the window closes I want it to reload the page they were originally on (the parent page).
Here is the code on the signin.php page…
<body onunload="opener.location=('')">
But all this does is make the sign in page become the page the user was on. I think I need to put something in the parentheses, but I can’t figure out what goes there.
To reload a page, you can set the location property as the current value, like this:
So for your case, you would use, literally:
You can also use the
reloadmethod of thelocationobject:This is the preferred method.
Also, please refer to the accepted answer for your previous question: Refreshing Parent window after closing popup
Documentation
window.locationon MDN – https://developer.mozilla.org/en/DOM/window.locationwindow.openeron MDN – https://developer.mozilla.org/Talk:en/DOM/window.opener