An event handler that is fired when changes are made to the active history. Calls to pushState or replaceState can trigger this event.
Overview Table Synchronous No Bubbles Yes Target dom/Element Cancelable No Default action None## Examples
window.onpopstate = function(event) {
alert("location: " + document.location + ", state: " + JSON.stringify(event.state));
};
history.pushState({page: 1}, "title 1", "?page=1");
history.pushState({page: 2}, "title 2", "?page=2");
history.replaceState({page: 3}, "title 3", "?page=3");
history.back();
history.back();
history.go(2);
Syntax Event handler parameters
Mozilla Developer Network : [popstate Article]
Microsoft Developer Network: [popstate Event Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4