TUTORIAL前端与浏览器FETCHED
History forward() 方法
History forward() 方法 History 对象 定义和用法 forward() 方法可加载历史列表中的下一个 URL。 调用该方法的效果等价于点击前进按钮或调用 history.go(1)。 语法 history.forward() 浏览器支持 所有主要浏览器都支持 forward() 方法 实例 实例 页面上创建一个前进按钮: [mycode2] function goForward(){..
更新于 2026/7/16
教程详情页默认 noindex。
History forward() 方法
History 对象
定义和用法
forward() 方法可加载历史列表中的下一个 URL。
调用该方法的效果等价于点击前进按钮或调用 history.go(1)。
语法
history.forward()
浏览器支持
![]()
![]()
![]()
![]()
![]()
所有主要浏览器都支持 forward() 方法
实例
实例
页面上创建一个前进按钮:
<!DOCTYPE html>
<html>
<head>
<script>
function goForward(){
window.history.forward()
}
</script>
</head>
<body>
<input type="button" value="前进" onclick="goForward()">
</body>
</html>
<html>
<head>
<script>
function goForward(){
window.history.forward()
}
</script>
</head>
<body>
<input type="button" value="前进" onclick="goForward()">
</body>
</html>
以上实例输出结果:
尝试一下 »
History 对象