O'Reilly logo

PHP jQuery Cookbook by Vijay Joshi

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

Creating an endless scrolling page

If you use Google reader or the new Twitter then you will understand what I am talking about. In both of these applications when you scroll and reach the bottom of the page they automatically load content that is appended to the bottom of the page. This behavior eliminates the need for pagination; the previous and the next buttons.

We will create an example that will have a similar functionality. On reaching the bottom of a page, an AJAX request will load data from a PHP script and will append it to the bottom of the page.

Getting ready

Create a folder named Recipe3 inside the Chapter9 directory.

How to do it...

  1. Create a new file named index.html inside the Recipe3 folder. In this file, create a DIV with container ...

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