Open Snoop9 opened 4 years ago
One solution is to set scrollThreshold: false
when there is no more content to append.
$container.on( 'load.infiniteScroll', function( event, response ) {
if ( !response || !Object.keys( response ).length ) {
// disable scroll load behavior if no response
$container.data('infiniteScroll').scrollThreshold = false;
return;
}
var data = JSON.parse( response );
$container.append( data.content );
});
Event when my path function returns nothing. It still tries to fetch next page with path as "undefined"
page-load.js:55 GET http://localhost:3000/undefined 404 (Not Found)
Hello, I'm using Infinite Scroll with this code :
But, when "/getLastPost" url is returning a blank JSON, infinite scroll is not detecting that empty result and is still trying to load the next page.
How can I fix this ?