Using setInterval in JavaScript without using an inline, anonymous function
<p>What I'm trying to achieve is that initially data will be loaded and then be updated every ten minutes using the same function.</p>

<p>Consider this code: </p>

<pre><code>var updateNamespace = (function() {
    var object = '#updates',
    load = 'loader';

    return {
        update: function() {
            $(object).addClass(load).load('update.php', function(reponse, status, xhr) {
                if (status == 'error') {
                    $(this).html('&lt;li&gt;Sorry but there was an error in loading the news &amp;amp; updates.&lt;/li&gt;');
                }
                $(this).removeClass(load);
            }); 
        }
    }
})();

setInterval(updateNamespace.update(), 600000);
</code></pre>

<p>I get this error:</p>

<pre><code>useless setInterval call (missing quotes around argument?)
</code></pre>

<p>How can I fix this?</p>

<p>What's a better and more elegant way of writing this or using the <code>setInterval</code> function?</p>

<p>Thanks.</p>
