Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "popstate"
- IN THIS ARTICLE
- General info
- Properties
- Browser compatibility
- Example
- Related Events
- The popstate event is fired when the active history entry changes. If the history entry being activated was created by a call to history.pushState() or was affected by a call to history.replaceState(), the popstate event's state property contains a copy of the history entry's state object.
- Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event. The popstate event is only triggered by doing a browser action such as a click on the back button (or calling history.back() in JavaScript).
- Browsers tend to handle the popstate event differently on page load. Chrome (prior to v34) and Safari always emit a popstate event on page load, but Firefox doesn't.
- $(window).on("popstate", function(){
- alert(1);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement