I had been looking for a script to refresh the webcam images on my site without refreshing the entire page, after a bit of digging i found this;
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
refreshImage = function()
{
img = document.getElementById("cam");
img.src="http://ephratareview.com/cam/mainstate.jpg?rand=" + Math.random();
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Auto-Refresh</title>
</head>
<body onload="window.setInterval(refreshImage, 1*1000);">
<img src="http://ephratareview.com/cam/mainstate.jpg" id="cam" />
</body>
</html>Rich