How do I make my website compatible with all those autopaging plugins out there that load the next page beneath the current, thereby saving a page reload?
+1
A:
You can't make it compatible with all plugins. You can make it compatible with a specific plugin. How to do that is probably described in the documentation for said plugin.
Fuzzy76
2010-02-17 10:35:44
+1
A:
It's depend on how you design your page.
Let's take a look at twitter page. The items there displayed in a li
, top to down. Implementing a autopaging to page like this will be quite simple.
- When page load, display a predefined number of item in list (10 or 20, or else)
- When user reach the end of list, (maybe detect the position of certain element, or else), load the next page via AJAX. The back end page should detect AJAX request and then only return a portion of page that contain the list item only
- In AJAX response handler block, do a DOM manipulation to add the newly received list item into the end of existing list.
In my project, I create function like this by myself. I'm using jQuery btw.
Donny Kurnia
2010-02-17 10:37:04
This is another facet that you have added to my concepts, which has rather altered my thinking on autopaging :). Now another doubt arises, How do I detect when the user has scrolled down to a certain level?? How to do this in jQuery??
OrangeRind
2010-02-17 18:28:58
Donny Kurnia
2010-02-17 21:56:22
Thanks a lot !!
OrangeRind
2010-02-19 19:56:10