Easy to learn about BOM of JavaScript 15th: JavaScript

Source: Internet
Author: User

Easy to learn about BOM of JavaScript 15th: JavaScript

It took about 20 days to finish learning the ECMAScript core of the largest JS module. Although ECMAScript is an important standard, it is not

The only part of JavaScript, of course, is not the only part to be standardized. In fact, a complete JavaScript implementation consists of the following three different parts:

Composed:

ECMAScript: the Core of JavaScript ECMAScript describes the syntax and basic objects of the language.

Browser Object Model (BOM): BOM describes the methods and interfaces for interacting with the browser.

Document Object Model (DOM): DOM describes the methods and interfaces for processing webpage content.

Let's continue to look at the BOM (Browser object model) study of the second module. Before learning BOM, I checked the introduction of BOM on the Internet.

Shao, this module probably does not have a uniform standard and has little public knowledge. Various browsers are expanding BOM implementation functions. Therefore, I just learned

Some public BOM object knowledge.

1. BOM Overview

IE 3.0 and Netscape Navigator 3.0 provide a feature BOM (Browser object model) for accessing and operating browser windows. Enable

With BOM, developers can move the window, change the text in the status bar, and perform other actions that are not directly related to the page content. Make BOM unique

It is often suspected that it is only a part of JavaScript, but there is no relevant standard.

2. BOM Extension

BOM mainly processes browser windows and frameworks. However, browser-specific JavaScript extensions are usually considered part of BOM. These extension packages

Including:

1. A new browser window is displayed.

2. Move and close the browser window and adjust the window size

3. locating objects with detailed Web browser Information

4. screen objects that provide detailed information about the user's screen resolution

5. cookie support

6IE extends BOM and adds ActiveXObject objects. ActiveX objects can be instantiated through JavaScript.

3. BOM Knowledge Overview

Because there is no relevant BOM standard, Each browser has its own BOM implementation. There are some de facto standards, such as having a window object and

Navigation Objects, but each browser can define its own attributes and methods for these objects or other objects. Browser Object Model (BOM) Enabled

JavaScript has the ability to "talk" with the browser ". There are no formal standards for BOM. Because modern browsers have almost achieved JavaScript Interaction

The same method and attribute are often considered BOM methods and attributes.

BOM provides some methods to access window objects. We can use it to move the window position, change the window size, open a new window, and close the window.

In the dialog box that appears, navigate to and obtain the customer's information, such as the browser brand version and screen resolution.

4. What knowledge should we learn about BOM?

1Window object: The top-level object of client JS. The Window object is automatically created whenever or when a tag appears.

2Location object: contains information about the current URL.

3Document object: contains the entire HTML document and can be used to access all elements on the page.

4Screen object: contains information about the client display.

5 history object: contains the URL accessed by the browser window.

6Naviqator object: contains information about the client browser.

7Popupalert object: Three message boxes can be created in JavaScript: Warning box, confirmation box, and prompt box.

8Timing object: the code is executed after a set interval, rather than immediately after the function is called.

9cookie object: used to identify users.

The above is my understanding of BOM in JS. If there is anything wrong with it, it will be corrected after further study.

Related Article

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.