View Full Version : refresh iframe

04-06-2009, 01:51 AM
hi ,

i have iframe on my web page which shows the web camera .
I want that iframe should refresh every 5 seconds.

Can anyone help me

04-06-2009, 10:57 AM
You need javascript to achieve this put this in your head

<script type="text/javascript">
function reloadiframe () {

function go_now () {


make sure your iframe has name="myiframe"

<iframe src="http://example.com" name = "myiframe" onLoad="reloadiframe();">

Though the onload is supported in most current browsers (IE5.5+, Firefox, Safari, Opera) it's not actually correct. Not sure of a better way though. Also this script will only work if both your parent document and iframe document are hosted on the same domain?

If its not on same domain there's some information of what to do here http://www.dyn-web.com/tutorials/iframes/

04-06-2009, 11:50 AM
why don't you just add this in the iframe window:

<meta http-equiv="REFRESH" content="5;url=theurltoyouriframe">