📜  history.state - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:46.255000             🧑  作者: Mango

代码示例1
// 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);