Hi,
Endless scrolling as in this example consists of two parts:
1. Remember which "page" you are on (on the server),
2. pull new contents from the server when you arrive at the bottom of the
page (in the browser).
What the code you linked to does is:
To achieve (2.): If you scroll down
$(window).scroll(function(){ ...})
and you are on the bottom of the page
if($(window).scrollTop() == ...) { ... }
then call a function on the server
SHtml.jsonCall(containerId, process)._2.toJsCmd
namely the function "process".
The "process" function knows about a var that stores the current "page"
(i.e., set of articles to be sent in one call), then gets the next bunch of
data from the database (this happens in "getItems") and increments this var.
Then, it uses JqJsCmds.AppendHtml to append the HTML for the new items to an
element with a given id in the HTML.
Hope that helps,
Tobias