Javascript Script Error: Object Expected
<p>I have a scriptlet in the ASPX page as below.  When I browse to this page, the script debugger appears saying "Micosoft JScript runtime error: Object expected".  I marked line with //&lt;--error here.  I removed everything and only left $(function(){});  It still complained about Object Expected.  Do you know why?  Thanks.  </p>

<pre><code>&lt;fieldset&gt;
    &lt;button id="Case5" name = "Case5" class="wizard" title="click here to select the case"&gt;
    Case 5 - AAA &lt;/button&gt;&lt;br /&gt;
    &lt;button id="Case6" name = "Case6" class="wizard" title="click here to select the case"&gt;
    Case 6 - BBB &lt;/button&gt;&lt;br /&gt;
&lt;/fieldset&gt;

&lt;script language="javascript" type="text/javascript"&gt;
$(function () { //&lt;--error here
    (":button").click(function () {
        appendSelection(this);
    });
});

function appendSelection(btn) {
    //ToDo: append the selected value to the hyperlink

    var caseNumber = btn.id;
    switch (caseNumber) {
       ....
    }
}
</code></pre>

<p>In the Site.Master the script libraries are</p>

<pre><code>    &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/i18n/jquery-ui-i18n.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.1.js" type="text/javascript"&gt;&lt;/script&gt;


&lt;script src="&lt;%: Url.Content("~/Scripts/ui/jquery.ui.datepicker.js") %&gt;" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="&lt;%: Url.Content("~/Scripts/datetimepicker_css.js") %&gt;" type="text/javascript" &gt;&lt;/script&gt;
&lt;script src="&lt;%: Url.Content("~/Scripts/lang/calendar-en.min.js") %&gt;" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="&lt;%: Url.Content("~/Scripts/json2.js") %&gt;" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;var appRoot =  '&lt;%:Url.Content("~/")%&gt;'&lt;/script&gt;
&lt;script src="&lt;%: Url.Content("~/Scripts/MyApp.js") %&gt;" type="text/javascript"&gt;&lt;/script&gt;
</code></pre>
