When is the Window.popstate event fired?
12 February 2023 (Updated 12 February 2023)
On this page
In a nutshell
The window.popstate
event is fired whenever the current history entry changes. This can be when:
- User presses the browser’s back or forward button.
- You programmatically invoke
history.back()
,history.forward()
orhistory.go()
.
Other notes
- To avoid annoying pop-ups, browsers may not fire the
popstate
event if the page hasn’t been interacted with.
Sources
Tagged:
Web APIs
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment