Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
119
rated 0 times [  122] [ 3]  / answers: 1 / hits: 15998  / 13 Years ago, sat, december 31, 2011, 12:00:00

Please can you people guide me how to make ajax call when scroll down


More From » ajax

 Answers
23
var no=1;
$(window).scroll(function () {
if(no==1)
{
if ($(window).height() + $(window).scrollTop() == $(document).height()) {
no=2;
$.ajax({
type: POST,
url: request.php,
data: datas,
cache: false,
success: function(html){

}
});
}
}
});


This does an ajax call when a user reaches at end of page.



You can specify a height at which it occurs.


[#88301] Thursday, December 29, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shelbiec

Total Points: 101
Total Questions: 106
Total Answers: 106

Location: Ivory Coast
Member since Fri, Oct 8, 2021
3 Years ago
;