I have a html page with a button pop-up. If I click on this button a new window Pops-up, I do all of my changes in this window and then click the close button. The html page with the popup button should refresh after I closed the pop-up window. Is this possible?
3 Answers
<body onunload="opener.location.reload(true);">
1 Comment
Jeff
Only thing to note here is that this will refresh the opening window ANY time the body is unloaded (this includes refreshes).
<script>function reload(){document.location = document.location}</script>
3 Comments
scunliffe
This script would reload "this" page, not the opener... or are you suggesting to inject this in the opener when closing the popup?
Carter Cole
sorry i wasn't paying attention didnt see he wanted to refresh opener... id use my function above on opener page and make the call from popup <body onunload="opener.reload();"> just another way to do it... that would work right?
Kevin Beal
If you have a hash in your URL it wont actually refresh the page, but just do whatever going to that hash does.