There is a catalog on the site, it is necessary when the user navigates to a detailed product card from this catalog, to implement a button back, that is, after clicking on which the user goes to the previously viewed page.

The problem could be solved by the windows.history.back() method, but there may be a pagination in the directory that the user can use and we need to transfer it to the page that he chose. Tell me, how can I solve this problem?

  • that is, if the user was on /about/ , and then went to the directory and moved to 2-3-4-5 page, then when you click on the button should get on about ? - Oleksandr
  • No, only to the catalog page the user walked through the pages 2,3, ..., 5 of the catalog switched to any particular product, pressed the button back and got to the place where he was previously in the catalog - ChromeChrome
  • Well, who said that windows.history.back() will not help? for him it makes no difference whether there is navigation or not - Raz Galstyan
  • Before creating a question, I tried this method and it works only for those cases where there is no pagination - ChromeChrome
  • And window.history.go(-1); will not help? - Puvvl

0