BOM:浏览器对象模型
window:浏览器窗口
Navigator(不建议):封装了浏览器信息,其对象不常用,因为会被人为修改
screen:控制屏幕
location:定位 代表当前页面的URL信息
Location {ancestorOrigins: DOMStringList, href: 'https://www.baidu.com/?tn=15007414_pg', origin: 'https://www.baidu.com', protocol: 'https:', host: 'www.baidu.com', …}
ancestorOrigins: DOMStringList {length: 0}
assign: ƒ assign()
hash: ""
host: "www.baidu.com"
hostname: "www.baidu.com"
href: "https://www.baidu.com/?tn=15007414_pg"
origin: "https://www.baidu.com"
pathname: "/"
port: ""
protocol: "https:"
reload: ƒ reload()
replace: ƒ replace()
search: "?tn=15007414_pg"
toString: ƒ toString()
valueOf: ƒ valueOf()
Symbol(Symbol.toPrimitive): undefined
[[Prototype]]: Location
设置新的地址
location.assign('https://sougou.com/')
document:当前页面
HTML DOM文档树
document.title
'百度一下,你就知道'
document.title='百度百度百度'
'百度百度百度'
获取具体的文档树节点
<dl id="lan">
<dt>Java</dt>
<dd>JavaSE</dd>
<dd>JavaME</dd>
<dd>JavaEE</dd>
</dl>
<script>
var dl = document.getElementById('lan')
</script>
获取cookie 客户端的本地信息 可以被劫持
document.cookie
服务器端可以设置 cookie:httpOnly 保证安全性
history 浏览器历史记录
history.back() //后退
history.forward() //前进