title: How to detect scroll position of page using jQuery
body: <p>I am having trouble with jQuery functionality on my website. What it does, is that it uses the <code>window.scroll()</code>  function to recognize when the windows changes its scroll position and at the change calls a few functions to load data from the server.</p>
  
  <p>The problem is the <code>.scroll()</code> function is called as soon as there is even a little change in the scroll position and loads data at the bottom; however, what I wish to achieve is to load new data when the scroll/page position reaches at the bottom, like it happens for Facebook feed.</p>
  
  <p>But I am not sure how to detect scroll position using jQuery?</p>
  
  <pre><code>function getData() {
    $.getJSON('Get/GetData?no=1', function (responseText) {
      //Load some data from the server
    })
  };
  
  $(window).scroll(function () {
      getData();
  });
  </code></pre>