<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>历史记录跳转</title>
</head>
<body>
<input type="button" value="前进" onclick="goForward()">
<input type="button" value="新网页" onclick="newPage()">
<script>
function newPage() { // 打开一个新的文档
window.location.assign('show.html');
}
function goForward() { // 前进
history.go(1);
}
</script><br />
-----------后退-------------<br />
<input type="button" value="后退" onclick="goBack()">
<script>
function goBack() {
history.go(-1);
}
</script>
</body>
</html>