javascript: $(window).height is not a function
<p>I have some javascript that I am using to resize my background image to fit my window.   There are some confusing things going on that I just don't get.</p>

<ol>
<li><p>Firebug and I assume my page doesn't recognize my <code>resizeFrame</code> function unless I place it below the body block.  Why?</p></li>
<li><p>Why am I getting the error:  <code>$(window).height is not a function</code>?</p></li>
</ol>

<p>Any suggestions or insights would be helpful.</p>

<pre><code>&lt;!-- This this placed in &lt;head&gt; block --&gt;
&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"&gt;&lt;/script&gt; 

&lt;script&gt; &lt;!-- This placed below body block --&gt;
  jQuery.event.add(window, "load", resizeFrame);
  jQuery.event.add(window, "resize", resizeFrame);

  function resizeFrame() 
  {
      var h = $(window).height();
      var w = $(window).width();
      $('body').css('background-size', w + 'px ' + h + 'px' );
  }  
&lt;/script&gt;
</code></pre>
