<input type=button value=前进 οnclick="window.history.go(1)">
<input type=button value=前进 οnclick="window.history.forward()">
<input type=button value=后退 οnclick="window.history.go(-1)">
<input type=button value=后退 οnclick="window.history.back()">
<input type=button value=刷新 οnclick="window.location.reload()">
<input type=button value=刷新 οnclick="window.history.go(0)">
<input type=button value=刷新 οnclick="window.location=location">
<input type=button value=刷新 οnclick="window.location.assign(location)">
<input type=button value=刷新 οnclick="window.location.replace(location)">
<input type=button value=后退+刷新 οnclick="window.history.go(-1);window.location.reload()">
注:window.
可不加
location.assign(URL) 方法会加载URL指定的文档内容。 如果使用 后退 功能,则回退到加载前页面。
location.replace(URL) 方法会加载URL指定的文档内容来替换当前页面内容。 如果使用 后退 功能,则无法回退到加载前页面。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/164185.html原文链接:https://javaforall.cn