布尔教育_Javascript基础_07 浏览器window对象
等风来<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
<script>
//我们不能直接操做浏览器对象我们只能通过操作BOM对象控制浏览器
//js最主要的是操作DOM(HTML代码) 或BOM(浏览器窗口)
//window.alert('nihao');//我们可以把它理解成一个方法,单独的情况下理解为函数名称;
window.confirm('是否确定?');//确认
window.open('./07closetest.html','_blank');//打开窗口
//window.close();//关闭窗口
console.log(window);//查看window对象的方法
//window对象的属性;
console.log(window.location);
</script>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
<script>
alert('nihao');
window.location.href="http://baidu.com";//修改windows地址栏上的子对象;
console.log(window.location);
alert(window.document);//这就是我们的dom对象
//操作dom对象首先得找到它
</script>
</html>