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>
Just reciprocating Alex's answer but with jQuery
Just reciprocating Alex's answer but with jQuery:
Or you can use small function:
I hope it helps.
I'm pretty sure all of the examples above only reload the iframe with its original src, not its current URL.
That should reload using the current url.
with jquery you can use this:
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
contentDocument
property 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.
Reload an iframe with jQuery
make a link inside the iframe lets say with id = "reload" then use following code
and you are good to go with all browsers.
Reload an iframe with HTML (no Java Script req.)
It have more simpler solution: which works without javaScript in (FF, Webkit)
just make an anchor inSide your iframe
When you click this anchor it just refresh your iframe
But if you have parameter send to your iframe then do it as following.
do not need any page url because -> target="_SELF" do it for you