Home Web Front-end JS Tutorial 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

May 16, 2016 pm 03:29 PM

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>);
Copy after login

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 of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Replace String Characters in JavaScript Replace String Characters in JavaScript Mar 11, 2025 am 12:07 AM

Replace String Characters in JavaScript

Custom Google Search API Setup Tutorial Custom Google Search API Setup Tutorial Mar 04, 2025 am 01:06 AM

Custom Google Search API Setup Tutorial

Example Colors JSON File Example Colors JSON File Mar 03, 2025 am 12:35 AM

Example Colors JSON File

8 Stunning jQuery Page Layout Plugins 8 Stunning jQuery Page Layout Plugins Mar 06, 2025 am 12:48 AM

8 Stunning jQuery Page Layout Plugins

10 jQuery Syntax Highlighters 10 jQuery Syntax Highlighters Mar 02, 2025 am 12:32 AM

10 jQuery Syntax Highlighters

Build Your Own AJAX Web Applications Build Your Own AJAX Web Applications Mar 09, 2025 am 12:11 AM

Build Your Own AJAX Web Applications

What is 'this' in JavaScript? What is 'this' in JavaScript? Mar 04, 2025 am 01:15 AM

What is 'this' in JavaScript?

10  JavaScript & jQuery MVC Tutorials 10 JavaScript & jQuery MVC Tutorials Mar 02, 2025 am 01:16 AM

10 JavaScript & jQuery MVC Tutorials

See all articles