And what about this code
Code:
the code (part 1)
<script language="JavaScript" type="text/javascript">
<!--
// original code by jovino
// � 2001 jovino
// all rights reserved
// MODIFICATION 1 & 2
// the following variables are used to customize the web cam
// the camImage variable can be an absolute or local path to the file
// make sure the camImage variable is quoted
// and the refreshIntervalSeconds variable is not
var camImage = 'webcam.jpg';
var refreshIntervalSeconds = 60;
// that�s all the javascript you need to customize!!
// please do not modify any of the script below this line
// there are no user serviceable parts inside
var secondsLeft = refreshIntervalSeconds;
function startClock() {
if (secondsLeft > 0) {
if (secondsLeft < 10) {
document.webCam.timer.value = '0' + secondsLeft;
} else {
document.webCam.timer.value = secondsLeft;
}
secondsLeft = secondsLeft - 1
timerID = setTimeout('startClock()', 1000);
} else {
date = new Date();
imageNumber = date.getTime();
document.webCamImage.src = camImage + '?' + imageNumber;
secondsLeft = refreshIntervalSeconds;
startClock();
}
}
// -->
</script>
the code (part 2)
Place this image tag somewhere on your HTML page. Leave the question mark at the end of the image source because it is for non-caching trickery. If you have a different sized image, make sure you change the width and height attributes. Also make sure that your image src is correct for your webcam image.
<img src="webcam.gif?" name="webCamImage" alt="web cam" title="web cam" width="320" height="240" border="0">
the code (part 3)
This mini-form is for the countdown timer. Omitting this code, you will give you JavaScript errors unless you either make the timer element type="hidden" or you further modify the portion of the javaScript that displays the timer. See the instructions below for information on modifying this script.
<form name="webCam" action="#">
Refresh in: <input type="text" name="timer" size="2"> seconds.
</form>
the code (part 4)
To make the whole thing go, you need to add an onLoad atribute to the <body> tag. Your code should look something like this:
<body onLoad="startClock()">
Bookmarks