title: jquery "$(document).ready(function () {" isn't working in IE
body: <p>Im using the MVC 2 framwork and have added some javascript for expanding divs. It works fine in firefox, chrome, opera and safari but not in internet explorer. I get an 'Object Expected' Error. Here is my code</p>
  
  <p>the jquery import is in the site.master file</p>
  
  <pre><code> &lt;head runat="server"&gt;
  &lt;title&gt;&lt;asp:ContentPlaceHolder ID="TitleContent" runat="server" /&gt;&lt;/title&gt;
  &lt;link href="../../Content/Site.css" rel="stylesheet" type="text/css" /&gt;   
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js" charset="utf-8"&gt;&lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>The Javascript, in the mvc view: the test alert comes up in IE but test2 doesn't.</p>
  
  <pre><code>   &lt;script type="text/javascript"&gt;
      alert("test");
  
      $(document).ready(function () {
          alert("test2");
          $(".expandingcontent").hide();
  
          $(".divexpand").click(function () {
              var divID = "#" + $(this).attr("id").substring(6);
              if ($(divID).is(":hidden")) {
                  $(divID).slideDown("slow");
              } else {
                  $(divID).hide();
              }
          });
      });
  &lt;/script&gt;     
  </code></pre>
  
  <p>Ive tried placing the javavscript at the beging of the page, at the end nothing seems to work. Ive also tried using a timeout but no success there either. I'm using IE 8, any help is very much appreciated Thanks!</p>