While JavaScript and ECMAScript are often used to express the same meaning, JavaScript has far more meaning than ECMA-262.
A complete JavaScript implementation should consist of three different parts:
- Core (ECMAScript): A basic standard for scripting languages
- Document Object Model (DOM): Methods and interfaces for controlling page content and structure
- Browser object Model (BOM): Methods and interfaces for accessing and manipulating browsers
(1) ECMAScript
The ECMAScript defined by ECMA-262 has no dependencies on the Web browser. ECMA-262 defines only the basis of this language, and on this basis can build a more complete scripting language.
The JavaScript language core defines very few APIs for the operation of text, arrays, dates, and regular expressions, but these APIs do not include input and output capabilities.
Input and output functions (such as network, storage, and graphics-related complex features) are provided by the host environment (host enviroment) that the JavaScript belongs to.
Our common web browser is just one of the ECMAScript implementations possible, and the hosting environment not only provides a basic ECMAScript implementation, but also provides an extension of that language so that the interface between the language and the environment interacts. These extensions, such as DOM, use the core type and syntax of ECMAScript to provide more specific functionality to enable operations against the environment. Other hosting environments include node (a server-side JavaScript platform) and Adobe Flash.
The ECMA-26 standard stipulates the following parts:
- Grammar
- Type
- Statement
- Key words
- Reserved words
- Operator
- Object
ECMAScript is a description of the language that implements the content of all aspects of the standard provision.
(2) Document Object Model (DOM)
The Document Object model (Dom,document object models) is an application programming interface (Api,application programming Interface) for XML but extended for HTML.
The DOM maps the entire page into a multi-tiered node structure. Each component of an HTML or XML page is a node of a certain type, and these nodes contain different types of data.
The World Wide Web Consortium, www Alliance, which is responsible for developing web communication standards, plans the DOM.
Note: Dom is not just for JavaScript, but many other languages implement DOM as well. However, in a Web browser, Dom-based implementations of ECMAScript have indeed become an important part of JavaScript's language.
(3) Browser object Model (BOM)
The Web browser supports a browser object model that can access and manipulate the browser window (bom,brower).
Developers use the BOM to control parts of the page that the browser displays.
Where the BOM is really different (and where it often causes problems), or it's part of the JavaScript implementation, but it doesn't have the relevant standards. This problem has been solved in HTML5, HTML5 is committed to writing many BOM functions into formal specifications.
JavaScript Learning: JavaScript implementation