- 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()
![image.png image.png](http://static.javashuo.com/static/loading.gif)