BOM is the browser object model, DOM is the Document Object Model, the former is to operate on the browser itself, and the latter is to operate on the content in the browser (can be seen as a container. This article will introduce you to the difference between javascriptbom and dom. if you are interested, learn about it and what is bom.
BOM is short for browser object model. it is short for browser object model.
BOM provides objects that interact with browser windows independently of content.
Because BOM is mainly used to manage the communication between windows, its core object is window
BOM consists of a series of related objects, and each object provides many methods and attributes.
BOM lacks standards, JavaScript syntax standardization organization is ECMA, DOM standardization organization is W3C
BOM was initially part of the Netscape browser standard
What do you learn in BOM
In the BOM tutorial, students will learn some objects that interact with the browser window, such as window objects that can be moved or adjusted in the browser size. they can be used to navigate the location object and history object to obtain the browser, the navigator and screen objects of the operating system and user screen information can use document as the portal to access HTML documents and manage frames objects of the framework.
BOM structure diagram
The window object is the top-level (core) object of BOM. all objects are extended through it, which can also be called window sub-objects.
Because window is a top-level object, you can call its sub-object without displaying the specified window object. for example, the following two lines of code are the same:
Example
document.write("www.dreamdu.com");window.document.write(www.dreamdu.com);
What is the difference between BOM and DOM in javascript?
This is two different concepts in the browser runtime.
BOM Browser Object Model
Provides objects that interact with browser windows independently of the content. Describes the methods and interfaces for interacting with the browser. you can access and operate the browser window. for example, you can pop up a new window, change the text in the status bar, and support cookies, IE also extends BOM, adds the ActiveXObject class, and instantiates ActiveX objects through js scripts)
DOM Document Object Model
DOM is a tree-based API for XML. Describes the methods and interfaces for processing webpage content. it is an HTML and xml api. DOM plans the entire page as a document composed of node levels.
DOM itself is a language-independent API that is not bound to Java, JavaScript, or other languages.
DOM in a specific language
DOM for XHTML and HTML. This DOM defines an HTMLDocument and HTMLElement as the basis for this implementation.