title: Why does jQuery return null for the height of the div?
body: <pre><code>$(document).ready(function(){
  
    function getDocumentHeight()
    {
       // What's the page height?
       var height = $('#mainbody').height();
       alert(height);
     ...
   getDocumentHeight();  }
  </code></pre>
  
  <p>jQuery keeps alerting <code>null</code> for the height of my <code>#mainbody</code> div. I don't get why, it should at least be <code>500px</code> or so.</p>