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>
You need to use
to find the source of the iframe and its URL needs to be on the same domain of the parent.
Here is another way
you can also use jquery. This is the same what Alex proposed just using JQuery:
Below solution will work for sure:
This is possible with simple JavaScript.
window.frames
syntax to fire a JavaScript function in iframe2. Just make sure to use theid
/name
of iframe2 and not thesrc
.SOLVED! I register to stockoverflow just to share to you the only solution (at least in ASP.NET/IE/FF/Chrome) that works! The idea is to replace innerHTML value of a div by its current innerHTML value.
Here is the HTML snippet:
And my Javascript code:
Hope this helps.