Help: HTML for webcam images

This page will explain how to set up the webcam HTML code manually on your homepage. TinCam can also create a webpage automatically, if you don't want to make the code yourself. See Webpage for details.

The most simple and effective way to make a webcam webpage is to show the picture with a standart (image) tag, and write a little java script that will reload the picture at a regular interval. Use the tag like this:

<img src="webcam.jpg" alt="My webcam" name="image1">

  • The 'src' parameter means 'source' and is the location of the image you want to display.
  • The 'alt' parameter means 'alternate text' and is a text the browser will display while loading, or if the user has disabled graphics.
  • The 'name' parameter used by the java script when it reloads the picture.

This javascript will reload a picture at a regular interval:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
<script language="JavaScript" type="text/javascript">
<!--
interval = 1000;
imgsrc = "TinCam.jpg";

function Refresh() {
   tmp = new Date();
   tmp = "?" + tmp.getTime();
   document.images["image1"].src = imgsrc + tmp;
   setTimeout("Refresh()", interval);
}

Refresh();
// -->
</script>