Learn BOM knowledge

BOM - Browser Object Model - (browser object model)

https://www.w3school.com.cn/js/js_window.asp

  • First taste of the powerful BOM
  // 浏览器中运行
  var value = confirm('你真的忍心离开我吗?');
  if (value) {
      // 关闭当前窗口
      close();
  } else {
      alert('你还是爱我的');
  }
  • BOM primary browser window and frame processing, a method of interacting with the browser and the interface

  • Javascript can be accessed by visiting the BOM objects, control, modify browser

  • BOM and DOM relationship

    • BOM contains the DOM, the browser provides access to a BOM give out the object, and then accessed from the BOM object to the DOM object, which can be operated js browsers and browser to read the document
      BOM {
        Window { // Javascript层级中的顶层对象,表示浏览器窗口
          Document {}
        }
        Navigator, ( 包含浏览器的信息 )
        History, ( 包含浏览器访问过的url )
        Location, ( 包含当前URL的信息 )
        Screen, ( 包含客户端显示屏的信息, Javascript可以利用这些信息来优化输出,以达到用户的显示要求 )
      }
    
Published 49 original articles · won praise 29 · views 1874

Guess you like

Origin blog.csdn.net/Brannua/article/details/105044711