-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
When you use the prefill option it will 404 trying to grab a page that doesn't exist before the last check fires. I encountered this working with WordPress & WooCommerce but have created a minimal test case linked below.
[InfiniteScroll] pageIndex. current page determined to be: 1 from next link
[InfiniteScroll] initialized. on products
[InfiniteScroll] prefill
[InfiniteScroll] request. URL: /shop/page/2/
XHR finished loading: GET "https://shopmmcurate.com.dev/shop/page/2/".
[InfiniteScroll] scrollThreshold
[InfiniteScroll] load. Products – Page 2 – Shop MMCurate. URL: /shop/page/2/
[InfiniteScroll] append. 2 items. URL: /shop/page/2/
[InfiniteScroll] prefill
[InfiniteScroll] request. URL: /shop/page/3/
[InfiniteScroll] last. URL: /shop/page/2/
GET https://shopmmcurate.com.dev/shop/page/3/ 404 ()
[InfiniteScroll] error. Error. URL: /shop/page/3/
XHR failed loading: GET "https://shopmmcurate.com.dev/shop/page/3/".
$( '.archive .products' ).infiniteScroll( {
path: '.page-numbers .next',
append: '.product',
prefill: true,
debug: true
} );
Test case: http://mmcurate.com/test/test-case.html