1. JS基础知识,规定语法(ECMA 262 标准)
  2. 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()

image.png


用户bPbA4lM
103 声望9 粉丝

« 上一篇
DOM性能
下一篇 »
JS-Web-API 事件

引用和评论

0 条评论