History API demo


1. 测试 back(), forward(), go(), length

我们先手动跳转到 2.html

history.length:

2. 测试 pushState(), replaceState()

3. 监听 window.onpopstate 事件

state:

location: