Node.js – Ajax Pagination without the Pages

Published on Oct 15, 2012 by Jamie Munro

With my recent endeavours into Node, I thought that taking a fun article like this one - CakePHP 2-0 Ajax Pagination WITHOUT The Pages – would be a really fun experiment to see how difficult it would be to accomplish in Node.

At the end of the day, the logic is still the exact same, retrieve the items, determine the max length, calculate the number of pages, and then perform AJAX as well scroll down to fill in more content as-needed.

Leveraging the Express API and Jade templates, this is quite painless to implement into Node.

Read more >

Tags: AJAX | jquery | pagination | JavaScript | jQuery | node

CakePHP 2-0 Ajax Pagination WITHOUT The Pages

Published on Feb 28, 2011 by Jamie Munro

As I promised in this article, I have created a full CakePHP example of performing AJAX pagination without the pages.  The goal of this article is to display news articles to a user.  As the user scrolls down, we will dynamically load in additional content so they can continue to scroll and read.

One of our challenges is to not load too much or too little content.  For more details on this, please review the theory article.  Let's begin.

Read more >

Tags: AJAX | CakePHP | pagination | jQuery

Creating AJAX Pagination WITHOUT The Pages

Published on Feb 21, 2011 by Jamie Munro

You may have noticed some changes in the way a few websites work.  For example, if you go to Google Images and do a search, there is no pagination (1, 2, 3, Next, Previous) anymore.  Instead Google loads the images as you need them, e.g. when you scroll down.

Another example is Facebook's newsfeed.  I read an excellent article a few months back on their developer blog about this design decision.  By default, Facebook will only load a "full screen" of information with minimal scrolling.  However, as soon as you start scrolling they begin to fetch and display more content.  In the article, Facebook described this decision as a bandwidth saver.  They found that a lot of people would navigate away from the newsfeed before ever scrolling down or only looking at the top content.  By only showing 10-15 posts, they can keep the size of their newsfeed down oppose to loading 30+ posts that are never going to be read!  File size can easily go down 100s of KBs per page view and when you're talking about millions of page views per second, that's a significant number.

Read more >

Tags: AJAX | jquery | pagination | jQuery