Category Archives for Javascript

PHP – Infinite Scroll Pagination using JQuery Ajax Example

Infinite Page Scroll Logo

 

How to make a site with infinite page scroll

All credits for the code go to these guys at ItSolutionStuff.com for the code. The code is good, but it has an issue if you scroll too fast with the browser, it gets confused and duplicates lines which makes things pretty messy quickly. I found a fix on Stack Flow which corrects the problem, so I am going to post the new code to use. Most of the code is the same except for the AJAX stuff, there is a bunch of changes we need to make.

 

You can see the scroll in action here CoolHipThings.com

 

Step 1 – Create the Posts table

 

Step 2 – Create the DB Configuration file

db_config.PHP

 

Step 3 – Create index.PHP

index.PHP

 

 

Update to JavaScript in index.PHP

Notice all the loaded = statements. Also the if statement had to be updated. You can read the original StackOverFlow Article here

index.php

 

Step 4 – Create data.PHP

data.PHP

 

Step 5 – Create loadMoreData.PHP

loadMoreData.PHP 

 

 

You may also be interested in the Amazon API Post or the PHP Email Form

 

Please go ahead and leave me a comment…

I would love to hear from you and if I have missed anything, let me know and I will add it.

I would appreciate you linking back to my blog if you found any of these articles useful.