I need to update/change the AJAX call while scrolling the page. I tried this with the scroll
handler, but it doesn't work.
var size = "8";
var from = "0";
var url = "mywebservice" + from + "&s=" + size;
$(document).scroll(function (e) {
var url = "mywebservice" + from + "&s=" + size;
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) {
++size;
}
$.ajax({
type: 'GET',
url: url,
data: { get_param: 'value' },
dataType: 'json',
success: function (data) {
$.each(data, function (index, element) {
var HTML ='<div>' + element.name + '</div>';
$('#container').append(HTML);
});
}
});
});