BOM中的history对象

我是研究僧i 提交于 2020-03-07 07:06:56

//有错误的地方请大佬可以评论指导一下

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript">
//window对象代表一个html文档.
//history代表当前页面的访问历史;获得:history对象是window对象的属性
//var  history=window.history;
//属性
//length-->当前标签页一共浏览过几个页面
//方法
//forward==》前进
//back==》后退
//go==》前进或者后退 含有参数填写0表示当前界面   填写-1表示返回界面   填写1表示前进界面
function fun1(){
    window.history.forward();
    }
</script>
</head>
<body>
<a href="01-hisitory对象2.html">01-hisitory对象2.html</a>
<input  type="button"  value="前进"  οnclick="fun1();"/>
</body>
</html>

                                                                                                                                                         

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript">
//window对象代表一个html文档.
//history代表当前页面的访问历史;获得:history对象是window对象的属性
var  history=window.history;
//属性
//length-->当前标签页一共浏览过几个页面
//方法
//forward==》前进
//back==》后退
//go==》前进或者后退
function fun1(){
    alert(window.history.length);
    window.history.back();
    }
</script>
</head>
<body><input  type="button"  value="后退" οnclick="fun1();"/>
</body>
</html>

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!