jQuery "Microsoft JScript runtime error: Object expected"
<p>I have the below code that does not seem to work at all :( I keep getting:</p>

<pre><code>Microsoft JScript runtime error: Object expected
</code></pre>

<p>The error seems to occur when the timeout is done. So if I raise the timeout with 10 seconds the error holds for another 10 seconds. </p>

<p>I want to be able to update the number of friends online async. The number is shown with the following html:</p>

<pre><code>&lt;a href="" id="showChat" &gt;Friends online &lt;strong id="friendsOnline"&gt;(?)&lt;/strong&gt;&lt;/a&gt;
</code></pre>

<p>The friends part is set at the first run, but when the timeout calls back it does not fire again. Also, I cannot see on which line the error occurs because if I want to break on the error it just shows "no source code" etc.</p>

<p>The code below is the code I'm using. Thanks!</p>

<pre><code>&lt;script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.js" type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src='/Scripts/MicrosoftAjax.js' type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src='/Scripts/MicrosoftMvcAjax.js' type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src='/Scripts/jquery.autocomplete.js' type="text/javascript"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt; 
$(document).ready(function() {
    UpdateFriendsOnline();
    function UpdateFriendsOnline() {
        window.setTimeout("UpdateFriendsOnline()", 1000);
        $.get("/Account/GetFriendsOnline", function(data) {
            $("#friendsOnline").html("(" + data + ")");

        });
    }
});
&lt;/script&gt;
</code></pre>
