I would like an iframe to refresh itself to the source path specified. What is the easiest way to do this inline with javascript?
thanks,
I would like an iframe to refresh itself to the source path specified. What is the easiest way to do this inline with javascript?
thanks,
If you want to refresh an iframe itself.
and you can try this.
Something like this:
The interval resets the iframe's
src
attribute ever 2 seconds (2000 milliseconds)Edit, to answer you comments: This, along with any other code that manipulates the DOM, should be in a
window.onload
event listener or similar like so:If you're also perhaps looking for a way of doing this without javascript enabled, and have access to modify the iframe HTML, then you could add this reload code to the
<head>
tag of the iframe HTML:Try this
Note, this will try to refresh the page every 3 seconds. Obviously, if the page takes a while to load, i.e. over 3 seconds then you wont see anything.
Hope this helps.
Try This
Interval Time Is 3 Second.