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.