title: Refresh all images with javascript?
body: <p>I am trying to load the latest image from a CCTV server for each of our cameras on our network.</p>
  
  <p>I have the following code, which works correctly and refreshes the image constantly. However, on the final version of the page there will be around 10 camera images on the page. I was wondering if the code I have now could be altered to refresh all images - not just specific ones.</p>
  
  <p>At first I thought I could just use the same identifier for each image, but then I realised that the source of each image differs.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
   &lt;title&gt;CCTV Test&lt;/title&gt;
   &lt;script type="text/javascript" language="JavaScript"&gt;
      newImage = new Image();
  
      function LoadNewImage()
      {
          var unique = new Date();
          document.images.ward.src = newImage.src;
          newImage.src = "http://192.168.1.64/image/WARD?time=" + unique.getTime();
      }
  
      function InitialImage()
      {
          var unique = new Date();
          newImage.onload = LoadNewImage;
          newImage.src = "http://192.168.1.64/image/WARD?time=" + unique.getTime();
          document.images.ward.onload="";
      }
   &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;img src="http://192.168.1.64/image/WARD" name="ward" onload="InitialImage()"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any pointers would be appreciated!</p>