If you are looking for endless scrolling, this is one thing, but only the More button does not require a plugin.
HTML
<div id="items"> </div> <button id="more">More</button>
Js
var page = 0; $('#more').click(function(){ page++; $('<div/>').appendTo('#items').load('the/same/url/?page='+page+' #items'); });
The .load function will make an AJAX call to the specified URL, and an additional selector will simply pull out that particular element. In this case, if the parameter? Since the page on your display page controls the offset of the request in order to pull out the necessary elements, the next set of elements will be added when loading the URL each time it is called.
Of course, you can create a unique AJAX page that simply returns HTML snippets for the next set of elements, but it depends a bit more on your architecture. However, you will save bandwidth / runtime by doing this.
methodin
source share