Need a simple way to repeatedly poll a file using javascript
<p>Hopefully the below is close, but I feel I'm doing the first part wrong.<br /></p>

<hr />

<p>Ideal outcome is status-remote.php to be polled every 2 seconds, while not being cached (hence the random nocache variable). </p>

<p>If it's relevant, the php file has two variables the status of which determines the visibility on this page.</p>

<pre><code>&lt;script id="status" type="text/javascript"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;
  var nocache = Math.random();
    setInterval(
     document.getElementById('status').src = '/status-remote.php?sid=2&amp;random='+nocache;
     }, 2000);
&lt;/script&gt;
</code></pre>

<p>Thanks so much for taking a look!</p>
