History API
History API
Section titled “History API”Introduction
Section titled “Introduction”The History API enables navigation through the browser session history and modifying the history stack for SPA navigation.
Topics Covered
Section titled “Topics Covered”- Navigation — Using back, forward, and go methods
- pushState & replaceState — Modifying the history stack
- PopState Event — Responding to back/forward navigation
- SPA Navigation — Building single-page app navigation
Summary
Section titled “Summary”pushState() adds history entries (SPA navigation). replaceState() modifies current entry. popstate event fires on back/forward. Essential for SPAs.