refresh image (javascript)
I got some code to refresh a image at certain time intervals, but it dosent seam to refresh the picture with the new one??
this is my code ... thanks
Code:
<HTML><BODY>
<!-- visionGS Script Code Begin -->
<SCRIPT language="JavaScript" type="text/javascript">
var t = 5 // interval in seconds
image = "image.jpg" //name of the image
function Start() {
tmp = new Date();
tmp = "?"+tmp.getTime()
document.images["visiongs"].src = image+tmp
setTimeout("Start()", t*1000)
}
</SCRIPT>
<!-- visionGS Script Code End -->
<IMG src=image.jpg border=1 name="visiongs">
</BODY>
</HTML>
Re: refresh image (javascript)
Quote:
Originally posted by chenko
Code:
<HTML><BODY>
<!-- visionGS Script Code Begin -->
<SCRIPT language="JavaScript" type="text/javascript">
var t = 5 // interval in seconds
image = "image.jpg" //name of the image
function Start() {
tmp = new Date();
tmp = "?"+tmp.getTime()
document.images["visiongs"].src = image+tmp
setTimeout("Start()", t*1000)
}
</SCRIPT>
<!-- visionGS Script Code End -->
<IMG src=image.jpg border=1 name="visiongs">
</BODY>
</HTML>
would it be because you have the same name for the image.
Re: Re: refresh image (javascript)
Quote:
Originally posted by scoutt
would it be because you have the same name for the image.
because the image is updated on the server... It is being used for a web cam, and i dont want to repeatively update the whole page...
the page the code is on is at http://frankhdale.demon.co.uk/cam/default.asp
this is the exact code that came from the visionGS software im using for my webcam.
sebs: thanks, i will try that when im back at work monday, thou i might do it in the week if i can be bothered :D:D