-
navigator
// navigator 识别浏览器的类型 const ua = navigator.userAgent const isChrome = ua.index0f('Chrome') console.log(isChrome)
-
screen
// screen console.log(screen.width) console.log(screen.height)
-
location
// location 分析拆解url各个部分 console.log(location.href) console.log(location.protocol) // 'http:' 'https:' console.log(location.pathname) // '/learn/199' console.log(location.search) console.log(location.hash)
-
history
// history history.back() history.forward()
【前端面试指南】JS-6-Web-API-BOM
最新推荐文章于 2020-08-18 16:00:32 发布