title: $(window).height() vs $(document).height
body: <p>I am having problem of getting wrong height with </p>
  
  <pre><code>$(window).height();
  </code></pre>
  
  <p>and got the similar question
  <a href="https://stackoverflow.com/questions/10569301/why-is-window-height-so-wrong">here</a></p>
  
  <p>In my case when I try </p>
  
  <pre><code>$(document).height();
  </code></pre>
  
  <p>it seems to return me correct result </p>
  
  <p>window height returns 320</p>
  
  <p>while document height returns 3552!</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/12015201/why-doesnt-window-height-return-a-value-but-document-height-does">this</a> question too </p>
  
  <p>But in my case window already gets loaded completely as I am calling height function after few ajax operations </p>
  
  <p>So what is the best way to know the height of the current window?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/4HucS.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/Q0Wtd.png" alt="enter image description here"></p>