您的位置:首页 > Web前端 > JavaScript

javascript:history.go()和History.back()的区别及应用

2016-05-10 17:18 621 查看

<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()">

1 history.go(0)

2 location.reload()

3 location=location

4 location.assign(location)

5 document.execCommand('Refresh')

6 window.navigate(location)

7 location.replace(location)

8 document.URL=location.href
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: