Reference from network:
Dom is a platform and language-neutral interface that enables programs and scripts to dynamically access and update the content, structure, and style of documents.
Bom defines the interfaces of various functional components of a browser that can be operated by JavaScript.
DOM
(Document Object Model) isHTML
AndXML
Application Interface (API
).
BOM
Mainly deal with browser windows and frameworks, but usually the browser-specificJavaScript
All extensions are considered part of BOM. These extensions include:
?
123456 |
A new browser window is displayed. Move and close the browser window and resize the window Locating objects with detailed web browser Information Screen Object that provides detailed information about the user's screen resolution Cookie support IE extends BOM and adds the activexobject class. ActiveX objects can be instantiated through JavaScript. |
javacsript
Yes through accessBOM
(Browser object model) object to access, control, modify the client (browser), becauseBOM
Ofwindow
Containsdocument
, The properties and methods of the window object can be directly used and perceived, so you can directly usewindow
Objectdocument
Attribute, throughdocument
You can access, retrieve, and modify the content and structure of the XHTML document. Becausedocument
The object is the root node of the DOM (Document Object Model) model. It can be said that BOM containsDOM
(Object), the browser provides the BOM object for access, from the BOM object toDOM
So that JS can operate the files read by browsers and browsers. Where
Dom includes:window
?
123 |
Window objects include attributes: Document, location, Navigator, screen, history, and frames. The document root node contains subnodes: forms, location, anchors, images, and links. |
Slavewindow.document
We can see that the most fundamental object of Dom is the sub-object of the window object of BOM.
Difference: Dom describes the methods and interfaces used to process web content. Bom describes the methods and interfaces used to interact with browsers.
Dom and BOM