Hi,
I have got a script to refresh a single image but I want the user to be able to change the refresh rate of the picture by clicking a link. I have tryed the following code:

<p><IMG src="http://rc-xbot.ath.cx/webcam.jpg" width="320" height="240" border="1" name="refresh">
  <SCRIPT language="JavaScript" type="text/javascript">
      <!--
	  function Change(t) {
	  var t = 2
      image = "http://rc-xbot.ath.cx/webcam.jpg"
      function Start() {
      tmp = new Date();
      tmp = "?"+tmp.getTime()
      document.images["refresh"].src = image+tmp
      setTimeout("Start()", t*1000)
      }
      Start();
	  }
      // -->
      </SCRIPT>
</p>
<p><a href="javascript:Change('2')">2</a> <a href="javascript:Change('10')">10</a></p>

But that refreshes the image once when the user clicks on the link.
Thanx in advance
Sam Rudge

This article has been dead for over six months. Start a new discussion instead.