Updating an image that is re-uploaded periodically
<p>I have a webcam script that sends a JPG via FTP to my webserver every 10 seconds (overwriting the original).</p>

<p>How can I get jQuery to refresh that image? I tried:</p>

<pre><code>window.onload = function() {
            $('body').prepend('&lt;img id="cam" src="ww.jpg" alt="" /&gt;');
            setInterval(runAgain, 12500);
        };

        function runAgain() {
            $.ajax({
                url:'ww.jpg',
                cache:false,
                beforeSend:function() {
                    $('#cam').remove();
                },
                success:function() {
                    $('body').prepend('&lt;img id="cam" src="ww.jpg" alt="" /&gt;');
                }
            });
        }
</code></pre>

<p>Note: I don't want to refresh the page if I can help it.</p>
