Differences between BOM and Dom

Source: Internet
Author: User

  

BOM

1. Bom is short for browser object model, that is, browser object model.

2. Bom has no relevant standards.

3.The most fundamental object of BOM is window.

From 1, we can see that Bom is closely related to the browser. Many browser things can be controlled through JavaScript, such as opening a new window, opening a new tab (Tab), closing the page, setting the webpage as the home page, or adding to favorites, etc... These objects are Bom.

As can be seen from 2: because there is no standard, different browsers can implement the same function in different ways. For the functions mentioned above, the JavaScript code required for different browser implementation functions may be different.

For example, adding a feature to favorites:

IE browser: window. External. AddFavorite (URL, title );

Firefox: window. Sidebar. addpanel (title, URL ,"");

Therefore, browser compatibility should be considered when writing this JavaScript code.

Although BOM does not have a set of standards, the JavaScript code for common functions of various browsers is still similar, and there are actually default standards for common functions. Therefore, you don't have to worry too much about browser compatibility. Not every browser has its own Bom, and you don't need to learn a BOM for every browser, only some browsers will display new features on BOM.

Dom

1. Dom is short for Document Object Model, that is, Document Object Model.

2. Dom is W3C standard.

3.The most fundamental object of Dom is document.(Upload upload Doc ument ).

Differences between BOM and Dom

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.