| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/API/History/state | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
History.state history state .
popstate state .
const currentState = history.state;
history . pushState() replaceState() null .
history.state pushState() State .
history.state .
// Should be null because we haven't modified the history stack yet
console.log(`History.state before pushState: ${history.state}`);
// Now push something on the stack
history.pushState({ name: "Example" }, "pushState example", "page3.html");
// Now state has a value.
console.log(`History.state after pushState: ${history.state}`);
| Specification |
|---|
| HTML # dom-history-state-dev |
This page was last modified on 2024 9 8 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |