1$(window).scroll(function () {
2 // End of the document reached?
3 if ($(document).height() - $(this).height() == $(this).scrollTop()) {
4 $.ajax({
5 type: "POST",
6 url: "index.aspx/GetData",
7 contentType: "application/json; charset=utf-8",
8 data: '',
9 dataType: "json",
10 success: function (msg) {
11 if (msg.d) {
12 $(".container").append(msg.d);
13 }
14 },
15 error: function (req, status, error) {
16 alert("Error try again");
17 }
18 });
19 }
20});
21