Problem reloading image source in Javascript
<p>I have a camera system ftping image files to a web server every few seconds. I have a web page that uses javascript to reload the source an image tag.</p>

<p>Periodically the web page displays only a portion of the image. I believe this is because the transfer has not completed when the web page request a reload.</p>

<p>Here is my code:</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;script language="javascript" type="text/javascript"&gt;
            var t = setTimeout("reloadImgs()", 10);

            function reloadImgs() {
                reloadImg("kobmimg");
                reloadImg("eafimg");
                t = setTimeout("reloadImgs()", 5000);               
            }

            function reloadImg(id) {

                var obj = document.getElementById(id);
                var src = obj.src;
                var pos = src.indexOf('?');
                if (pos &gt;= 0) {
                    src = src.substr(0, pos);
                }
                var date = new Date();
                obj.src = src + '?v=' + date.getTime();

                return false;
            }       
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;img src="eaf_camera_image.jpg" id="eafimg" width="350px" /&gt;
        &lt;img src="kobm_camera_image.jpg" id="kobmimg" width="350px" /&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>Any</strong> solutions would be appreciated.</p>
