the recent project requires that when users enter a page, they should distinguish between a forward jump or a click on the return button
to return to the current page.
this reminds me of the event that listens to the user clicking the back button.
HTML5 has a history management method that includes history.pushState ()
methods and popstate
events. You need to use the history.pushState () method to add the status of the current page to the browser"s browsing history. The popstate event is triggered when the user clicks the back or back buttons to access the saved historical state.
but: is not compatible with Safari browsers!
find a compatible listener for the click event of the browser"s back button, or determine that the current page is from the returned method.