How can I load a PHP file every 5 seconds with JavaScript
<p>I want a php program to be executed every 5 seconds using JavaScript. How can I do that?</p>

<p>I tried using: </p>

<pre><code>&lt;script type="text/javascript"&gt;
    setInterval(
        function (){
            $.load('update.php');
        },
        5000
    );
&lt;/script&gt;
</code></pre>

<p>But it doesn't work.</p>
