day-16.3 BOM需要记住的对象(window.history)

window.history这个对象存储的当前标签页的访问记录,

通过console.log(window.history),可以查看该对象的具体参数和值;

其中length:4;是表示该页面总共访问过4个页面;

可以通过window.history.go(数值);去实现访问记录的跳转,0代表当前页,1为往前跳转一个访问记录,-1代表往后跳转一个访问记录;

同样功能的函数还有;window.history.back和window.history.forward;,分别代表前一个和后一个。

posted @ 2018-07-30 16:10  bibiguo  阅读(96)  评论(0)    收藏  举报