-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Description
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/History/pushState
What specific section or headline is this issue about?
History: pushState() method
What information was incorrect, unhelpful, or incomplete?
The page says: "Add a listener for the popstate event in order to determine when the navigation has completed. The state parameter will be available in it."
Yet the popState page (https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event) says: Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event. The popstate event will be triggered by doing a browser action such as a click on the back or forward button (or calling history.back() or history.forward() in JavaScript).
_
What did you expect to see?
I'd expect it to say e.g. "You cannot listen for state changes using popstate, so maybe you should reconsider your entire approach."
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/web/api/history/pushstate
- MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/history/pushstate/index.md
- Last commit: ab8736c
- Document last modified: 2023-09-27T04:57:54.000Z