webcam images. You are free to use this code for any purpose you like.
You'll notice here the Restil cam, assuming it's operational. We'll go through the code step by step to explain what it does.
bName = navigator.appName;
The first block of code initializes some variables. isopen2 is a random number. camurl2 is the url of the cam image. tmpimage2 is a temporary image variable.
The firstimage2 function sets the onload variable of the image to always call the doimage function anytime an image has been loaded. It also loads an image in the temporary image variable. The +isopen2 variable adds the random number to the end of the url.
The doimage function increments the random number, copies the temporary image into the image on the page, and loads the next image. The isopen2 variable makes sure that the url to the image is always different, at least as far as the browser is concerned. This makes sure that the browser won't think the image is already cached. If the browser thinks the image is cached, it won't grab a new one.
This routine will run until stopped, a new page is loaded, or a broken image is returned.
To use this code for your own site, the only thing you need to change is the camurl2 variable and the url in the image tag. If you're using your cam on drivemeinsane.com, this code is generated automatically when the page is displayed.