Javascript Tutorial - Continuous Pagination

Michael Kuehl post an intresting tutorial about creating continuous pagination on youw web sites. He writes the following:

«Woah there, what's this! A Javascript tutorial!? Yes, I know its been a while since a Javascript tutorial graced the pages of Switch On The Code - but what can I say? I kind of got bored with writing them. And so, after a few month hiatus (and a couple fresh ideas for tutorials), they are back.

So what is on the plate for today? Well, we are going to take a look at how to implement continuous pagination in javascript. What is continuous pagination, you ask? That's a very good question, and it's actually a little bit difficult to describe. Say you have a list with a large number of entries - much more than you would want to load and display at once. The general tactic would be to paginate them - display 10-20 at once, and then have the user click 'next' to see the next 20, and so on and so forth.

ut if for the most part, the user is just quickly scanning through these entries, this can get annoying. The user has to click and wait for the next batch of entries to load every time that they are done with the current set. Continuous pagination gets rid of this problem. As the user approaches the end of the entries currently displayed, the next entries are requested asynchronously and appended to the end of the list displayed to the user. This way, the user never has to do anything directly to get the next entries - they are just always there waiting in the list when they are needed! »

You can read more on the Switch on the Code site.

dedicated server hosting
Advertise on this site

Recent Comments