pklauzinski/jscroll — pull request #23 by orszaczky (2013-12-15 18:48:35+00:00)
Title: Added refresh option to reinitialize the plugin on each update when used to paginate search results dynamically updated with AJAX.

When paginating search results returned from an AJAX call...

$('#search').keyup(function() {
var search = $(this).val();
$.get('/search', {search : search}, function(results) {
$('.scroll-table').html(results);
$('.scroll-table').jscroll();
});
});

After getting the new set of search results, when we scroll to the bottom, jScroll appends content of the next page of the previous (old) query.

So if my last _nextHref was "/search?query=A&page=3" and I enter B in the search field, instead of loading "/search?query=B&page=2" from the new href, it would load "/search?query=A&page=3" from the old href.

Refresh option added to reinitialize the plugin on each load, to prevent it from loading the old href.

Usage:

$('.scroll').jscroll({
refresh: true
});