浏览器对象模型BOM之history对象

a页面:

<title>history对象</title>
 </head>
	 <script type="text/javascript">
	 <!--
		  /*
			   history对象存储了访问过的页面。
		  */

		  function fun(){
				history.forward();
		  }
	 //-->
	 </script>
 <body>
	  aaaaaaaaaaaaaaaaaaaaaaaaaaa
	  <a href = "b.html">b.html</a>
	  <input type="button" value="前进" οnclick="fun()">
 </body>
</html>

b页面:

</head>
  <script type="text/javascript">
	 <!--
		  /*
			   history对象存储了访问过的页面。
		  */

		  function fun(){
				history.forward();
		  }

		  function fun1(){
			   history.back() ;
		  }

		  function fun2(){
			   history.go(2) ;
		  }
	 //-->
	 </script>
 <body>
	  bbbbbbbbbbbbbbbbbb
	  <a href = "c.html">c.html</a>
	  <input type="button" value="前进" οnclick="fun()">
	  <input type="button" value="后退" οnclick="fun1()">
	  <input type="button" value="直接去d页面" οnclick="fun2()">
 </body>
</html>

c页面:

<script type="text/javascript">
	 <!--
		  /*
			   history对象存储了访问过的页面。
		  */

		  function fun(){
				history.forward();
		  }

		  function fun1(){
			   history.back() ;
		  }

		  function fun2(){
			   history.go(-2) ;
		  }
	 //-->
	 </script>
 <body>
	  ccccccccccccccc
	  <a href = "d.html">d.html</a>
	  <input type="button" value="前进" οnclick="fun()">
	  <input type="button" value="后退" οnclick="fun1()">
	  <input type="button" value="直接去a页面" οnclick="fun2()">
 </body></html>
d页面:

<script type="text/javascript">
	 <!--
		  /*
			   history对象存储了访问过的页面。
		  */

		  function fun1(){
			   history.back() ;
		  }

		  function fun2(){
			   history.go(-3) ;
		  }
	 //-->
	 </script>
 <body>
	  ddddddddddddddddd
	  <input type="button" value="后退" οnclick="fun1()">
	  <input type="button" value="直接去a页面" οnclick="fun2()">
 </body>
</html>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值