Question

I have a page that contains an iframe, and the iframe opens a popup.

This popup after submitting a form should close and reload the iframe that opened it.

The popup is closed and redirect by this way:

window.opener.location.href = "http://www.myweb.com/iframe.php";
window.close ();

This has worked for me while I've been working directly from the iframe but when I do it from the page that contains the iframe the iframe does not refresh.

So... how can I reload the iframe in that case?

Was it helpful?

Solution

Well, there is no way to access the DOM of an iframe if it doesn't have the same origin as the containing page. So in that case, you won't be able to tell if the form is submitted. You would have to edit the JS of the iframe page and have the popup reload that page when you submit the form.

window.opener.location.reload()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top