I have the following script that causes the page to fetch more records from the database and load them at the end of the page. It's working well in Safari 10.0 on Mac but not with Google Chrome 53.0.2785.143. If I resize the Chrome browser window down to almost smartphone size it does then start to work.
There's nothing in the Console when it's not working so there aren't any errors to debug. If I watch the web server log there are no requests when I attempt to scroll down the page so nothing is happening at all.
Here's the script:
< script type = "text/javascript" >
var skip = 20;
var action = "<?php echo $action ?>";
$(window).scroll(function() {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
loadArticle(skip);
skip += 20;
}
});
function loadArticle(pageNumber) {
$('#inifiniteLoader').show('fast');
$.ajax({
url: "getMoreEvents.php",
type: 'POST',
data: "action=" + action + "&skip=" + skip,
success: function(html) {
$('#inifiniteLoader').hide('1000');
$("#content").append(html); // This will be the div where our content will be loaded
}
});
return false;
} < /script>