E
E
egor_5432020-04-27 03:22:41
JavaScript
egor_543, 2020-04-27 03:22:41

How can I make the page reload when I click the back button in the browser?

If you switch from /home.php to /catalog.php, then the back/forward buttons in the browser work fine (they move through the history with a page reload). But if you switch between records in the history that are on the same file (/catalog.php) but have different GET parameters, then the page will not be reloaded. For example, we were at /catalog.php?category=1 and clicking on a product opened a pop-up window, when opened, the address changed via history.pushstate to /catalog.php?id=1. Now, if you click on the back button in the browser, the address bar will change to /cataloh.php?category=1, but the content will not change in any way. It would not be desirable to load through AJAX.
How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-04-27
@HistoryART

I am almost 100% sure that you are using redirects, so I advise you to either go to links or use this:
click

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question