I've attached bellow the script which I'm using for refreshes of 3 seconds and more, it's taken from our test page so it might have some unneeded code in it. Perhaps it can help.
Good .js script I also found on:
http://www.cowboyscripts.org/?page=webcam
Regards D.
EXAMPLE HTML CODE:*************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>IP CAMERAS</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<style type="text/css">
<!--
a {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
text-decoration: none;
}
table {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
<SCRIPT language=JavaScript>
<!-- hide
// browser sniffer:
browserVer = parseInt(navigator.appVersion);
if (navigator.appName == "Microsoft Internet Explorer" && browserVer < 4)
{
alert("Internet Explorer 3 users need to hit 'Refesh' to update the image");
}
// The variables you need to change are: the filename of the picture,
// the refresh rate, and further down the FORM ACTION (look for the ***).
var picname = "
http://193.77.25.56/images/DOMOFON.jpg"; // set this to the filename of your campicture
var speed = 3; // "var speed" is the refresh rate adjustment in seconds
var y = 2; // expected time to download the picture file
var x = speed; // current countdown
var cachepic = new Image();
<!-- Change "JSCamRemote.html" to whatever you want to call the page that
// opens in the remote window. -->
function startClock() {
if (x != "00") {
x = x - 1;
//document.form0.clock.value = x;
if (x == y) {
recache()
}
if (x <= 0)
{
reload()
}
timerID = setTimeout("startClock()", 1000);
}
}
function recache() {
onError=null
var now = new Date();
var camImg = picname //+ "?" + now.getTime();
cachepic.src = camImg;
}
function reload() {
document.images.campicture.src = cachepic.src;
x = speed;
//document.form0.clock.value = x;
}
//end hide -->
</SCRIPT>
</head>
<body bgcolor="#3399FF" onload="startClock()">
<table width="180" border="1" align="center" cellspacing="0" bgcolor="#666666">
<tr bgcolor="#333399">
<td height="20" bgcolor="#333399"><div align="center"><strong><font color="#FFFFFF" size="1">CAMERA</font></strong></div></td>
</tr>
<tr>
<td height="148" valign="middle"><div align="center"><img src="
http://193.77.25.56/images/DOMOFON.jpg" name="campicture" width=320 height=240 border=0 id="campicture">
</div> </td>
</tr>
</table>
<div align="center"> </div>
</body>
</html>