title: Get new window height after jQuery AJAX
body: <p>I feel like the answer to this question is going to be embarrassingly simple, but it's eating up a lot of time and I can't see the solution. I'm making a simple infinite scroll function, and need the script to recognize the new height of the window after loading more content. The value is always the same as first load time. I based this latest code on <a href="https://stackoverflow.com/questions/9249047/jquery-rebind-window-scroll-after-a-successful-ajax-call">another answer here</a>, but it's still not working. Thoughts?</p>
  
  <pre><code>var scrollFunction = function(){
          var myTop = jQuery(window).scrollTop();
          var myHeight = jQuery(window).height();
          if (myTop &gt;= myHeight){ 
              $(window).unbind("scroll");
              jQuery.ajax({
                  type: 'POST',
                  url: '/ping/thumbs.php',
                  data: 'foo=bar',
                  success: function(data){
                      $(".thumbnails").append(data);
                      $(window).scroll(scrollFunction);
                  },
                  dataType: 'html'
              });
          };
      };
      $(window).scroll(scrollFunction);
  </code></pre>