Reload <img> element from same source
<p>I have an image at the URL <a href="http://192.168.1.53/html/cam.jpg" rel="noreferrer">http://192.168.1.53/html/cam.jpg</a> (from a Raspberry Pi) and this image is changing very fast (it is from a camera).</p>

<p>So I want to have some JavaScript on a website that will reload this image every second for example.</p>

<p>My HTML is:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;Pi Viewer&lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
    &lt;meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"&gt;
  &lt;/head&gt;
  &lt;body&gt;

      &lt;style&gt;
          img,body {
              padding: 0px;
              margin: 0px;
          }
      &lt;/style&gt;

      &lt;img id="img" src="http://192.168.1.53/html/cam.jpg"&gt;
      &lt;img id="img1" src="http://192.168.1.53/html/cam.jpg"&gt;

      &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>And my script:</p>

<pre><code>function update() {
    window.alert("aa");
    document.getElementById("img").src = "http://192.168.1.53/html/cam.jpg";
    document.getElementById("img1").src = "http://192.168.1.53/html/cam.jpg";
    setTimeout(update, 1000);
}
setTimeout(update, 1000);
</code></pre>

<p>alert is working, but the image is not changing :/ (I have 2 images (they are the same))</p>