Web APIs-BOM操作

1,453 阅读1分钟

Window对象

BOM(Browser Object Model ) 是浏览器对象模型

延迟函数

setTimeout(回调函数,等待的毫秒数)

清除延时函数

let timeId = setTimeout(回调函数,等待的毫秒数)
clearTimeout(timeId)

js执行机制

image.png

image.png

image.png

location对象

href 属性获取完整的 URL 地址,对其赋值时用于地址的跳转

search 属性获取地址中携带的参数,符号 ?后面部分

hash 属性获取地址中的啥希值,符号 # 后面部分

reload 方法用来刷新当前页面,传入参数 true 时表示强制刷新

navigator对象

image.png

histroy对象

image.png