How to make ajax pagination googleable?
I have a pagination that uses ajax to change to next page.
| Text Here |
1 2 3 4 5 6
When a user clicks each numbers, js loads next page using ajax.
my question is, how do I make each page g开发者_JAVA百科oogleable?
What you are going to want to do is have a non AJAX fallback. When a user clicks on the link, you can fire off JavaScript events and then return false to the click event. If a user doesn't have javascript enabled or a search engine is crawling your website, let them not execute the javascript and follow your href naturally.
Then simply make the page the user clicks display the same data that would have been loaded with an AJAX request.
Eg, some of your code could like like this:
<a onClick="ajaxStuff(); return false;" href="stuff/page/2">Page 2</a>
精彩评论