Forum Moderators: open
I know this script produces a messy result over time, but bear with me for now.
This script is to upload a webcam feed. IMAGE.jpg is continuously updated (hidden the IP as per forum rules). I want the image to be uploaded every second without having blank space (like a <meta http-equiv="refresh" content="1;"> would).
Now, this script works fine locally, but when I upload it to the server, it starts telling me that it needs expected values of ';' or '}' depending on what I try to change to fix it.
I'd appreciate some help :)
Thanks - script is below.
<html>
<script>
var c="#*$!/IMAGE.jpg?"
function count()
{
c=c+1
document.image.src=c
setTimeout("count()",1000)
}
</script>
<body onload="count()">
<p align="center">Live Webcam Feed</p>
<p align="center"><img src="#*$!/IMAGE.jpg" name="image"></p>
</body>
</html>
<html>
<script>
var webcamimage;
var imgBase="/IMAGE.jpg?"
var c = 0;
function count()
{
webcamimage.src=imgBase+(++c);
}
function init()
{
webcamimage = document.getElementById("webcamimage");
if( webcamimage )
{
setInterval("count()",1000);
}
}
window.onload = init;
</script>
<body>
<p align="center">Live Webcam Feed</p>
<p align="center"><img src="#*$!/IMAGE.jpg" name="image" id="webcamimage"></p>
</body>
</html>