Fetching additional content when end of page is reached

I first saw this technique used at the Humanized Reader; Google Reader started using it too since then. Argument about semantic pointlessness of the majority of pagination is very convincing.

We have this issue at the RSS.KZ "endless page" is a feature of the v2.0 of the RSS.KZ service (currently in alpha).

Tools

In this tutorial I used the Mootools JavaScript library.

Download

You can download the demo files here.

At times, pagination does not convey any meaning - say when you have a essentially endless list of articles from various RSS feeds. One solution is to load all the articles - that's out of question when there are more than a handful; the web 2.0 way is to load additional content when reader is at the end of content.


// Check if at the end of page (mootools makes it easy)
if ( (ws.scrollSize.y-ws.size.y-ws.scroll.y)<200 )
{
  new Ajax
  (
    'page.php?page='+page,
    {
      onSuccess: function(req)
      {
        // Append loaded part to the main content
        $('content').innerHTML = $('content').innerHTML+req;
        page++;
      },
    }
  ).request();
}

photo is a part of the Alpha Orionis and does freelance too.

I recommend

Freakonomics Getting Things Done Getting Real Steve Krug: Don't make me think

I'm using

Mac Coda RoR

Hosting is kindly provided by