A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/PopStateEvent/popstate below:

popstate ยท WebPlatform Docs

popstate Summary

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
val [in]
Type: Function A script function to do something when the event is fired.
Attributions

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