There is a page with a list of goods, the transition through the pages is implemented by Ajax, if we click on the product, it opens in the same tab. And then, when we press the button back to return to the list of products, we get to the first page. How can we realize that we get to the same page with which we left? For example, dolistali to 5, opened the product and returned as well on the fifth? 
|
1 answer
On the event "click" pagination hung history.pushState(null, null, href); where href is the link on which the AJAX request goes.
- oneJust note that in old browsers you still have to put up with the fact that it will return to the first page. If the project is serious, then as an option I can offer you for old browsers to make a mechanism for navigating through pages without
ajax. And it seems to be good forSEO, although I'm not sure here. - user200141 - Thank! So do it! - Nikolay
|
window.historyfromhtml 5. You need to usehistory.pushStatewhen clicking on navigation buttons. - user200141