Filed under: Developer, Web services
Endless pages: Ditching the "Next" button
"Pagination," i.e. turning a long set of, say, search results into a series of pages with "Next" and "Previous" buttons, is no fun. It can be a pain to implement, and is very much a pain to use, and yet it exists on every site that pulls a lot of records from a database. Surely we can't load all of the records at once if there are thousands of them, so is there an alternative? Yes! And I have a feeling some of you have already guessed the magic word--Ajax. Web developer Peter Forde has written an article explaining the "endless pageless" technique, which uses Ajax to automatically and seamlessly load more results from the server as you scroll toward the bottom, which guarantees that you'll never have to click on another "Next" link as long as you live.You can take a look at the technique in action on this page. This technique isn't brand new, of course--Microsoft, for example, has employed it for a long time on Live.com Image Search--but it's still fairly rare. There's also one caveat that Peter Forde doesn't mention: With his implementation, it's not possible to bookmark or link to a particular point of the results. He cleverly uses cookies to avoid breaking the browser's Back button, but without a permalink the technique still isn't ready for all situations. However, as the technical limitations are overcome, I think we'll be seeing fewer and fewer Next buttons around the web.







After spending the better part of an hour on 