Home  >  Article  >  Web Front-end  >  What is javascript bom and the difference between bom and dom_javascript skills

What is javascript bom and the difference between bom and dom_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:29:311508browse

What is BOM

BOM is the abbreviation of browser object model, referred to as browser object model
The BOM provides objects that interact with the browser window independently of content
Since BOM is mainly used to manage communication between windows, its core object is window
BOM is composed of a series of related objects, and each object provides many methods and properties
BOM lacks standards. The standardization organization for JavaScript syntax is ECMA, and the standardization organization for DOM is W3C
The BOM was originally part of the Netscape browser standard

What will you learn in the BOM chapter

In the BOM tutorial, students will learn some objects that interact with the browser window, such as the window object that can move and adjust the size of the browser, the location object and history object that can be used for navigation, and the browser can be obtained and operated. Navigator and screen objects for system and user screen information, you can use document as the entrance to access HTML documents, manage frames objects, etc.

BOM structure diagram

The window object is the top-level (core) object of the BOM. All objects are extended through it. It can also be called a child object of window

Since window is a top-level object, you can specify the window object without displaying it when calling its sub-object. For example, the following two lines of code are the same:

Example

document.write("www.dreamdu.com");
window.document.write(<a href="http://www.dreamdu.com">www.dreamdu.com</a>);

jaWhat is the difference between BOM and DOM in vascript?

These are two different concepts in the browser runtime.

BOM Browser Object Model

Provides objects for interacting with the browser window independent of 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 expanded the BOM and added ActiveXObject. Class, you can instantiate ActiveX objects through js scripts, etc.)

DOM Document Object Model

DOM is a tree-based API for XML. It describes the methods and interfaces for processing web content. It is an API for HTML and XML. DOM plans the entire page into a document composed of node levels.

DOM itself is a language-independent API, it is not tied to Java, JavaScript or other languages.

Language-specific DOM

DOM for XHTML and HTML. This DOM defines an HTMLDocument and HTMLElement as the basis for this implementation.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn