BOM的history对象

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>history对象</title>
</head>
<body>
<input type="button" value="front" onclick="f1()">
<a href="history_obj1.html">555</a>
<script>
//history内部有三个方法:forward,back,go 一个属性 length
function f1() {
// history.forward();
history.go(1);//history.go(0)代表当前页面
}


</script>

</body>
</html>
======================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
</head>
<body>
<input type="button" value="back" onclick="f2()">
<script>
function f2() {
// history.back();
history.go(-1);
alert(history.length);// 2 返回历史URL个数

}


</script>

</body>
</html>
上一篇:Python 带命名空间的XML


下一篇:命名空间