History API demo
1. 测试 back(), forward(), go(), length
我们先手动跳转到 2.html
back
forward
go(-1)
go(0)
go(1)
go(2)
history.length:
2. 测试 pushState(), replaceState()
pushState()
replaceState()
3. 监听 window.onpopstate 事件
state:
location: