BOM:浏览器对象模型
![window window代表 浏览器窗口 window.alert(1) undefined window.innerHeight 708 window.innerWidth 150 //大家可以调整浏览器窗口试试… Navigator Navigator封装了浏览器的信息 大多数时候不会用navigator对象,因为会被人为修改
screen
代表屏幕尺寸
screen.width
1536
screen.height
864
location(important)
location代表当前页面的URL信息
host:"www.baidu.com/"
href:"https://www.baidu.com/"
protocol:"https:"
reload:f reload() //刷新网页
//设置新的地址
location:assign('https://blog.yxkstudy.com/')
document
document代表当前的页面
document.title
'Title'
document.title='yxk'
'yxk'
获取目标的文档树节点
<body>
<dl id = "app">
<dt>Java</dt>
<dt>JavaSE</dt>
<dt>JavaEE</dt>
</dl>
<script>
let dl = document.getElementById('app');
</script>
</body>
获取cookie(不要暴露)
document.cookie
''
服务器可以设置cookie:httpOnly
history
history代表浏览器的历史记录
history.back() //后退
history.forword() //前进