title: Ajax call back function called always after first call
body: <p>I want to do auto load with using ajax call back function but the <code>GetData</code> function is keep being called after first with same parameters. Here is my javascript codes:</p>
  
  <pre><code>        var currentPage = 0;
          var isFinished = false;
          var lastScrollTop = 0;
       $(window).data('ajaxready', true).scroll(function (e) {
              if ($(window).data('ajaxready') == false) return;
  
  
              $(window).scroll(function (event) {
                  var st = $(this).scrollTop();
                  if (st &gt; lastScrollTop) {
                      if (st &gt; window.innerHeight) {
                          var amountValue = $("#amount").val();
  
                          var firstPrice = 0;
                          var lastPrice = 10000;
  
                          InfiniteScroll(firstPrice, lastPrice);
                      }
  
                  } 
  
              });
  
          });
  
  
  
   function InfiniteScroll(firstPrice, lastPrice) {
  
              if (firstPrice &lt; 0 || firstPrice == undefined) {
                  firstPrice = 0;
              }
              if (lastPrice &lt; 0 || lastPrice == undefined) {
                  lastPrice = 10000;
              }
  
              if (isFinished) {
                  return;
              }
  
  
              $('#divPostsLoader').html('&lt;img src="images/loader.gif"&gt;');
  
              var rawPath = window.location.pathname.split('/');
              var categoryId = rawPath[rawPath.length - 1];
  
              $("#load").show();
  
  
  
              $.ajax({
                  type: "POST",
                  url: "http://localhost:60579/AjaxCallPage.aspx/GetData",
                  data: "{categoryId:" + categoryId +
                              ",page:" + currentPage +
                              ",skip:'9',firstPrice:" + firstPrice + ",lastPrice:" + lastPrice + "}",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function (data) {
                      if (data.d.length &lt; 3) {
                          isFinished = true;
                      }
                      var products = JSON.parse(data.d);
                      $.each(JSON.parse(data.d), function () {
  
                         // ... do smth..
  
  
  
                      });
  
  
                      currentPage += 1;
  
                      $("#load").hide();
                  }
              });
          };
  </code></pre>
  
  <p>I don't scroll down but it calls <code>GetData</code> function after first call. Do you have suggesiton?</p>