The contents of JavaScript contain the following three parts:
- ECMAScript (CORE): JavaScript Language Foundation;
- DOM (Document Object model): Provides access to HTML and XML interfaces;
- BOM (Browser object model): Provides objects and methods that are independent of the content and interact between browser windows.
I. ECMAScript
ECMASCRIPT Specifies the core syntax for JavaScript scripts, such as data types, keywords, reserved words, operators, objects, and statements, which do not belong to any browser.
The ECMAScript standard defines the most central content in JavaScript scripting, which is the "skeleton" of a JavaScript script that can be extended on top of it, such as the DOM (Document Object model) and the BOM (browser object model).
Currently, ECMAScript has released five versions, the latest version is V5, released in December 2009.
Two. DOM
The DOM is the abbreviation of "Document Object Model", abbreviated as "The file Objects models", which is developed by the publisher.
The DOM defines the interface for JavaScript to manipulate HTML documents, providing access to HTML documents (such as body, form, div, textarea, etc.) and how to do so.
Three. BOM
- The BOM is an abbreviation for the browser object model.
- BOM provides an object that is independent of the content and interacts with the browser window
- Because the BOM is primarily used to manage the communication between Windows and Windows, its core object is window
- A BOM is composed of a series of related objects, and each object provides many methods and properties
- BOM lack of standard, JavaScript Grammar Standardization Organization is ECMA,DOM standardization Organization is the
- The BOM was originally part of the Netscape browser standard
Unfortunately, the BOM is only an extension of ECMAScript, there is no relevant standards, the company has not made the specification of the section, each browser manufacturer has its own BOM implementation, which can be said to be the weakness of the BOM.
In the BOM tutorial, students will learn some objects that interact with the browser window, such as window objects that can be moved, resize the browser, and can be used to navigate the location object and the History object, to get the browser, Navigator and screen objects for operating system and user screens, you can use document as a portal to access HTML documents, frames objects for managing frames, etc.
Note: The BOM has some "de facto standards", such as manipulating the browser window, getting browser version information, etc., in different browsers, they are implemented the same way.
BOM structure diagram
The Window object is the top-level (core) object of the BOM, all of which are extended through it, or can be called a child of the window
Because window is the top-level object, you can call its child objects without displaying the indicated window object, for example, the following two lines of code are the same:
document
.
write
(
"
www.dreamdu.com
"
)
;
window
.
document
.
write
(
"
www.dreamdu.com
"
)
;
javascript--Browser object model BOM, text Object model DOM, JavaScript language Foundation ECMAScript