Ajaxy Pagination using jQuery

Saw this today: AJAX Pagination using jQuery and PHP with Animation. While it is quite simple to add paging using jQuery, why not make it work without the jQuery as well?

It isn’t too hard to do, add a url to each of the a tags, then load the content based on that instead.

This would be the code (some of it has been left as an exercise for the reader):

the table would look like this (or you know, something else…)

page.php is sort of like a controller… for a one off page this would be fine, I would abstract it a bit more if it were part of a bigger site.

paged_results.tpl.php Spit out the stuff to the users

Here is script.js… it has the javascript that would be used to make it ahem… ajaxy

Code is here if you want it: https://gist.github.com/767437

flattr this!