anjlab/jquery-infinite-scroll — pull request #3 by webjunkie (2014-02-04 15:07:58+00:00)
Title: Add resetPage method and 'extra' option

I'm using this in production where I have a sort button that changes the sorting of the list. Therefore I needed a resetPage method and a method that attaches some information to the request for a new page (e.g. which sort or filter is applied).

Usage:

$("#items").infiniteScroll.resetPage();
$("#items").infiniteScroll.setExtra({sort: 'popularity'});

Can also be set at the beginning and the data will be sent along:

$("#items").infiniteScroll({
itemSelector: '.widget',
extra: {some data here},
...
});

Also I added a cache for data in the last row that is encountered first. So one can do `

` for an item and the infinite scroll will attach `id=123` to every request and the backend can better figure out pagination stuff if needed.