O'Reilly logo

CouchDB and PHP Web Development Beginner's Guide by Tim Juravich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding simple pagination using jQuery

As our application grows, posts will start to fill up the profile of a user. What happens if our application becomes successful, and people start using it? Hundreds of posts will be printed to the profile view each time the page loads. Something like this could absolutely cripple your application as it starts to grow.

With that in mind, we're going to create some pagination on our profile pages. Our simple pagination system will work as follows:

  1. By default, we'll show 10 posts on a page. When a user wants to see more, they'll click on a Load More link.
  2. When the Show More link is clicked, jQuery will figure out how many items to skip and tell Bones which documents to retrieve.
  3. Bones will use Sag to call CouchDB ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required