Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1657 Is it possible to auto-refresh an image every X seconds?

You are here: irt.org | FAQ | JavaScript | Image | Q1657 [ previous next ]

Try:

<html>

<head>
<script language="JavaScript"><!--
function refreshIt() {
   if (!document.images) return;
   document.images['myCam'].src = 'myCam.gif?' + Math.random();
   setTimeout('refreshIt()',5000); // refresh every 5 secs
}
//--></script>
</head>

<body onLoad=" setTimeout('refreshIt()',5000)">

<img src="myCam.gif" name="myCam">

</body>

</html>

Feedback on 'Q1657 Is it possible to auto-refresh an image every X seconds?'

©2018 Martin Webb