Web APIs: History reference
12 February 2023 (Updated 12 February 2023)
In a nutshell
Explain like I’m five.
The History
interface lets you manipulate the browser’s session history – the pages visited in the current tab or iframe.
Recipes
Get number of elements in the session history
This will include
Go to the previous page in session history
This is the same action as when the user clicks the browser’s back button. When there’s no previous page, nothing happens.
Go to the next page in session history
This is the same action as when the user clicks the browser’s forward button. When there’s no next page, nothing happens.
Go to specific page in session history
Add an entry to the session history stack
See History.pushState for more details.
Replace current entry
See History.replaceState
for more details.
Sources
Tagged:
Web APIs
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment