js复习之BOM
1.什么是BOM?

BOM[Browser Object Model],浏览器对象模型

BOM提供与浏览器相关的API。

2.screen对象

width属性

描述:返回显示器分辨率的宽度
语法:screen.width

height属性
描述:返回显示器分辨率的高度
语法:screen.height

3.history

length属性
描述:返回历史的长度
语法:history.length

forward()
描述:前进
语法:history.forward()

back()
描述:后退
语法:history.back()

go()
描述:前进或后退
语法:history.go(int)
例:
history.go(3),前进3步
history.go(-2),后退两步

4.location对象

href属性

描述:获取/设置浏览器URL地址

语法:location.href = value

reload()
描述:重新加载页面
语法:location.reload()

5.navigator

appVersion
描述:返回浏览器的版本号
语法:navigator.appVersion

相关文章:

  • 2021-09-29
  • 2021-06-18
  • 2022-12-23
  • 2021-04-30
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-03
  • 2022-01-06
  • 2022-12-23
  • 2021-04-10
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
相关资源
相似解决方案