Skip to content

Comment on Browser History (2013)

Comments

You can use the pageshow event to detect when the browser navigates back in history to a page in the back/forward cache: https://developer.mozilla.org/en-US/docs/Web/Events/pageshow

More generally, you shouldn't make a "single-page app" unless you really need to. The web is designed for navigating between multiple documents. Browser features like history and bookmarks will work better if you stick to the standard behavior.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.