Hi Freddo,
How about this?
<html>
<head>
</head>
<body onload ="getNew()">
<P Id ="P1"><img src="cam.gif"></P>
<script language="JavaScript">
function getNew(){
var tmp = new Date(); //get system date
var thisHour = tmp.getHours();//get hours from system date
var thisMin = tmp.getMinutes();//get minutes from system date
if(thisMin < 10){
thisMin = "0" + thisMin;
}
var thisSec = tmp.getSeconds();//get seconds from system date
if (thisSec < 10){
thisSec = "0" + thisSec
}
window.status = "Time: " + thisHour + ":" + thisMin + ":" + thisSec
//I stuffed the time in the status bar, cos it always looks better
P1.innerHTML = "<img src \"cam.gif\">"
window.setTimeout("getNew()", 5000);
}
</script>
</body>
</html>
I also chucked in some if statements to pad out minutes and seconds with zeros if they were at less than ten.
HTH
interrupt
|