通过history.go()完成
history.go(-1); 后退
history.go(0); 刷新
history.go(1); 前进
通过三个按钮响应这三个消息即可
<html>
<body>
<p> 这是神奇的代码 </p>
<script>
function back(){
history.go(-1);
}
function forward(){
history.go(+1);
}
function refresh(){
history.go(0);
}
</script>
<input type=button value=后退 onclick ="back()">
<input type=button value=前进 onclick ="forward()">
<input type=button value=刷新 onclick ="refresh()">
<body>
</html>