有关回退事件的区别:history.go()和history.back()

来源:互联网 发布:唐小僧 坚持以数据和 编辑:程序博客网 时间:2024/04/29 21:21

在页面中可以这样:

<input type=button value=刷新 onclick="window.location.reload()">


<input type=button value=前进 onclick="window.history.go(1)">


<input type=button value=后退 onclick="window.history.go(-1)">


<input type=button value=前进 onclick="window.history.forward()">


<input type=button value=后退 onclick="window.history.back()"> 后退+刷新<input type=button value=后退onclick="window.history.go(-1);window.location.reload()">

但是如果要特定回退到摸个指定页时,需要这样写:history.go(i),i是去指定的某页数字

0 0