Fe-interview: [js] 第212天 举例说明常用的BOM属性和方法有哪些?

Created on 13 Nov 2019  ·  3Comments  ·  Source: haizlin/fe-interview

第212天 举例说明常用的BOM属性和方法有哪些?

我也要出题

js

Most helpful comment

window(浏览器窗口)
主要属性有:

  • name:浏览器窗口的名字
  • top:代表最顶层窗口
  • parent:代表父级窗口
  • self:代表当前窗口
  • innerWidth:指浏览器窗口的内宽(不含菜单栏、地址栏、工具栏、状况栏)

在 IE 下使用

document.getElement.clientWidth 
// 代替 window.innerWidth
  • innerHeight:指浏览器窗口的内高(不含菜单栏、工具栏、地址栏、状态栏)

window 方法:

  • alert():弹出一个警告对话框
  • prompt();弹出一个输入对话框
  • confirm();弹出一个确定对话框
  • close();关闭窗口
  • open();打开一个❤️窗口
  • 延时器:window.setTimeout('code', 1000)
  • 定时器:window.stInterval('code', 1000)

All 3 comments

window(浏览器窗口)
主要属性有:

  • name:浏览器窗口的名字
  • top:代表最顶层窗口
  • parent:代表父级窗口
  • self:代表当前窗口
  • innerWidth:指浏览器窗口的内宽(不含菜单栏、地址栏、工具栏、状况栏)

在 IE 下使用

document.getElement.clientWidth 
// 代替 window.innerWidth
  • innerHeight:指浏览器窗口的内高(不含菜单栏、工具栏、地址栏、状态栏)

window 方法:

  • alert():弹出一个警告对话框
  • prompt();弹出一个输入对话框
  • confirm();弹出一个确定对话框
  • close();关闭窗口
  • open();打开一个❤️窗口
  • 延时器:window.setTimeout('code', 1000)
  • 定时器:window.stInterval('code', 1000)

history, navigator, screen, location

image

Was this page helpful?
0 / 5 - 0 ratings