- JS基础知识,规定语法(ECMA 262 标准)
- JS Web API,网页操做的API(W3C标准)
JS Web API:
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()
