
© deanpugh.com 2006, all rights reserved. Copyright Notice
Last Updated: Tuesday 15th September 2009 - 04:42
HTML Image Refresh
Use the code below to refresh an image on a page. I used this on my web cam page instead of refreshing the whole page, which would take longer to load each time.
<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>
This code was found on http://www.irt.org/.




