saving pagination
I have ma开发者_运维问答de 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?
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
精彩评论