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() ;