History 对象的方法
方法 | 描述 | IE | F | O |
---|---|---|---|---|
back() | 加载 history 列表中的前一个 URL | 4 | 1 | 9 |
forward() | 加载 history 列表中的下一个 URL | 4 | 1 | 9 |
go() | 加载 history 列表中的某个具体页面 | 4 | 1 | 9 |
示例代码
Demo10
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>Title</title>
<script type="text/javascript">
function goForward() {
history.forward();
}
</script>
</head>
<body>
<a href="Demo11.html">Demo11</a>
<input type="button" value="前进" onclick="goForward()"/>
</body>
</html>
Demo11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>Title</title>
<script type="text/javascript">
function goBack(){
history.back();
}
</script>
</head>
<body>
青花瓷~ <input type="button" value="后退" onclick="goBack()"/>
</body>
</html>