title: I want to stop auto scrolling when I search the record?
body: <p>I have auto scroll-er on my index page and also I have a search functionality on that page when I search for the record they give the result. When I scroll down the page a new record is added automatically.  I want to disable the auto loader when I search the record that's it. Does anybody have an idea? </p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
  $().ready(function () {
      $("#hdnStudentCount").val(5);
  });
  
  function AddStudentRecord() {
             $.ajax({
          type: 'Get',
          url: '/Home/getdeal',
          data: {
              lastdeal: parseInt($("#hdnStudentCount").val()) + 1,
          },
  
          async: false,
          dataType: "html",
          success: function (data) {
                data = JSON.parse(data);
              for (var i = 0; i &lt; data.length; i++) {
  
                  if (data[i] != '') {
                      $("#studentTemplate").tmpl(data[i]).appendTo("#divMain");
                      var DealID = (data[i]["DealID"]);
                      $("#hdnStudentCount").val(parseInt(DealID));
                      $('div#last_msg_loader').html('&lt;img src="/Images/ajax-loade.gif"&gt;');
                  }
  
              }
  
          },
          error: function (xhr, ajaxOptions, thrownError) {
              alert(xhr.status);
              alert(thrownError);
          }
      });
  }
  
  $(window).scroll(function () {
  
      if ($(window).scrollTop() == $(document).height() - $(window).height()) {
          AddStudentRecord();
      }
  });
  $('#developer').click(function (e) {
      // do something fancy
      return false; // prevent default click action from happening!
      e.preventDefault(); // same thing as above
  });
  &lt;/script&gt;
  </code></pre>