How to auto load the content on page scroll
This technique is used in Twitter, Facebook and several other websites. New Facebook is using this technique to load more posts and updates. when the user scroll down the page all the old posts are displayed on the screen.
Step1: Create mysql table
CREATE TABLE IF NOT EXISTS `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `message` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;
Step2: Create config file for database connection – config.php:
Step3: Now display latest messages – index.php:
Step6: Add css for better design:
Now, you can use this technique to load your feed easily.
- Previous Post
- Next Post