I have two iframes on a page and one makes changes to the other but the other iframe doesn’t show the change until I refresh. Is there an easy way to refresh this iframe with jQuery?
<div class="project">
<iframe id="currentElement" class="myframe" name="myframe" src="http://somesite.com/something/new"></iframe>
</div>
If the iframe was not on a different domain, you could do something like this:
But since the iframe is on a different domain, you will be denied access to the iframe’s
contentDocumentproperty by the same-origin policy.But you can hackishly force the cross-domain iframe to reload if your code is running on the iframe’s parent page, by setting it’s src attribute to itself. Like this:
If you are trying to reload the iframe from another iframe, you are out of luck, that is not possible.