BOM and DOM, BOMDOM

Source: Internet
Author: User

BOM and DOM, BOMDOM

  • Concept:

1. BOM (Browser Object Model ):

The browser object model is closely related to the browser by name. Many browser behaviors are controlled by JavaScript, such as opening a new window, opening or closing a tab, setting a webpage as a home page, or adding it to favorites, these functions are essentially BOM operations. BOM is composed of a series of objects that interact with browser windows independently of the content.


2. DOM (Document Object Model ):

Document Object Model, which is related to the document. The document here refers to the webpage. A webpage is sent to the client browser by the server. The HTML received by any browser is the same, so DOM is irrelevant to the browser. It focuses on the content of the webpage. DOM defines a series of objects for accessing, manipulating, and creating content, structures, styles, and actions in a document. When the page content is changed, JavaScript uses DOM to obtain the access entries for all elements in the document (HTML, XHTML, and XML documents, methods and attributes for adding, moving, changing, or removing elements.

  • Contact and difference:



1. Both BOM and DOM are composed of a series of objects with attributes and Methods. javascript can manipulate these objects to implement specific functions.

2. Javascript consists of ECMAScript and BOM, which contains DOM. ECMAScript describes the syntax and basic objects of the language,

BOM describes the methods and interfaces used to interact with the browser, and DOM describes the methods and interfaces used to process webpage content.

3. BOM has no standards, DOM standards are W3C (World Wide Web Alliance), and JavaScript syntax Standardization Organization is ECMA.

4. The fundamental object of BOM is the window object, which indicates the entire browser window, but not the content contained in it. The basic object of DOM is

Document object, which is actually the property of the window object. Document is an object that belongs to both BOM and DOM.


After understanding BOM and DOM and Their Relationship with javascript, I feel that a large piece of haze in my mind has vanished,New progress has been made in "blindly touching images. Javascript is an object-and event-driven language that includes the objects defined in BOM and DOM, you can change the attributes of an object and execute the object to implement the specific functions in the real world. This is the same as the previous C/S project development.


What is the difference between bom and dom?

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.) The document structure BOM consists of a series of related objects. Shows the basic BOM architecture. Window object in BOM: it is the core of the entire BOM. All objects and sets are returned to the window object in some way. The Window object indicates the entire browser Window, but does not need to indicate the content contained in it. Document Object: it is actually the property of the window object. This object is unique in that it belongs to both BOM and DOM. From the BOM perspective, document objects are composed of a series of sets that can access each part of the document. Location object: it is the property of the window object and the document Object. Location object indicates the URL of the loading window. In addition, it can parse URI. Navigator object: Navigator contains a large amount of Web browser-related information. Various browsers support different attributes and methods for this object. Screen Object: You can obtain information about the user's Screen. 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. The DOM of a specific language targets the DOM of XHTML and HTML. This DOM defines an HTMLDocument and HTMLElement as the basis for this implementation. Other DOM, including SVG, supports DOM in different browsers. Mozila supports the best, almost all DOM Level 2 and some DOM Level 3. All DOM Level1 and most DOM Level2 are supported in Opera and Safrai. IE, supports most DOM Level 1. Various levels of DOM Level 1 include DOM Core and dom html. The former provides XML-based document structure. The latter adds HTML-specific objects and methods to extend DOM Core. DOM Level 2 introduces several new modules: DOM view, event, style, traversal, and range DOM Level 3 introduces a unified method for loading and saving documents. DOM Core is extended to support all XML1.0 features

What is the difference between the BOM of JavaScript and DOM?

Both are required.
BOM is a browser object model used to obtain or set browser attributes and behaviors, such as creating a window, obtaining screen resolution, and browser version number.
DOM is a Document Object Model Used to obtain or set the attributes of tags in a document, for example, to obtain or set the value of an input form.
BOM does not have much content, mainly DOM.

DOM has no direct relationship with the browser because its operation object is Document.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.