BOM操作(Browser Object Model:浏览器对象模型)
文章目录
- JS基础知识,规定语法(ECMA 262 标准)
- JS Web API,网页操作的API(W3C标准)
JS Web API:
- DOM
- BOM
- 事件绑定
- ajax
- 存储
BOM知识点
- navigator(浏览器的信息)
- screen(屏幕的信息)
- location(url的信息)
- history(前进、后退信息)
//navigator
const ua = navigator.userAgent //获取浏览器的信息
const isChrome = ua.indexOf('Chrome')
//screen
console.log(screen.width)
console.log(screen.height)
//location
console.log(location.href)
console.log(location.protocol)//"http:" "https:"
console.log(location.pathname)
console.log(location.search)
console.log(location.hash)
//history
history.back()
history.forward()
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论