I have a popup window which opened from iframe, this iframe contains a script to open that window.
The iframe is inside a popup of a third party application. My problem is when I close the window I need to refresh the main page(Third Party). I've tried it without include it inside the third party application and it worked and refreshed, but when I put it inside the application it's not working.
I think maybe it will not work because I open the window from iframe so the opener is iframe not a page, but I don't know how to fix this problem.
This code that I use to refresh the page after closing the window:
function RefreshParent() {
if (window.opener != null && !window.opener.closed) {
window.opener.location.reload();
}
}
window.onbeforeunload = RefreshParent;