I have made a pagination for a list. The list contains links for different pages. What is the best way to to "save" the pagination "page" when user goes to different page and comes back to page where the pagination is the pagination gets resetted to page one. Save the current page to cookies or what? Any examples for saving pagination?
A:
When the user interacts with the pagination, update a has value in the url using location.hash
.
For example, this could equate to the 2nd page of pagination results:
index.html#2
This covers browser history - leaving the page and hitting the Back button. It also means they can link to it directly and send that link.
For having them return to the site directly and preserve the pagination, then resort to cookies.
To summarize: cookie and location.hash
michael
2010-09-01 21:00:59