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

location对象

1.href 属性: 是指要连接到其他的URL
写法一、window.location.href='demo_window对象的close方法.html' ;
写法二、window.location='demo_window对象的close方法.html' ;
<title>location对象</title>
 </head>
	<script type="text/javascript">
	<!--
		/*
					掌握:1 href属性
					      2. reload()方法:重新加载本页面
		*/
		function fun(){
			//window.location.href = "history对象/b.html" ;
			window.location = "history对象/b.html" ;
		}

		function fun1(){
			window.location.reload();
		}
	//-->
	</script>
 <body>
		<input type="button" value="直接去b.html" οnclick="fun()">
		<input type="button" value="重新加载本页面" οnclick="fun1()">
 </body>
</html>



2.reload方法: 刷新
写法: window.location.reload() ;
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值