// Log the state of
addEventListener("popstate", (event) => {
console.log("State received: ", event.state);
});
// Now push something on the stack
history.pushState({ name: "Example" }, "pushState example", "page1.html");
history.pushState(
{ name: "Another example" },
"pushState example",
"page1.html",
);PopStateEvent: state property / notebook
PopStateEvent: state property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.