Answer the question
In order to leave comments, you need to log in
How to properly manage browser history?
Hello! When searching for materials on the site, I use dynamic content loading, i.e. the user enters characters, and the search results appear in the result block. If the user clicks on some result and goes to another page, then going back there is no longer the entered data by which he found this article.
Therefore, after each data receipt, I decided to record in the history the URL by which the user will return.
Everything works correctly, when the user returns, in the address bar I see the address that I need, but instead of the page at this address, I see the data that was loaded using the ajax request.
Tell me where to dig?
window.history.pushState(null, "title", uri);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question