onpopstate event
See original GitHub issueHello,
Is it possible to latch onto the window.onpopstate
event Navigo uses for forward/back buttons? I can use it easily enough, but then navigo stops working 😃
I have a page transition in this project, so it’s not possible to re-render the menu in this case. I’m manually updating the .active
class on the menu with jQuery, which works fine, except for the forward/back browser buttons.
Was thinking a custom event could be fired onpopstate with the window.location.pathname
passed to it, but interested in your thoughts.
Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Window: popstate event - Web APIs | MDN
The popstate event of the Window interface is fired when the active history entry changes while the user navigates the session history.
Read more >Handling window.onpopstate events - Learn ECMAScript
The window.onpopstate event is fired automatically by the browser when a user navigates between history states that a developer has set.
Read more >window.onpopstate is not working; nothing happens when I ...
You get a popstate event only if you add one or more history entry/entries and later the user clicks the back button in...
Read more >JavaScript popstate Event - The Simplest Explanation
The popstate event fires whenever the browser is navigated to a page with the same document object as the current page. Note that...
Read more >The PopStateEvent - W3Schools
Event Types. These event types belongs to the PopStateEvent Object: Event, Description. popstate, The event occurs when the window's history changes ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh yes, of course. D’oh!
Thanks again.
This will pollute your route handlers but can be solved with partial execution (or currying).