JavaScript implementation
While JavaScript and ECMAScript are often used to express the same meaning, JavaScript has a much larger meaning than the one set out in ECMA-262. A complete JavaScript implementation should consist of the following three different parts:
- Core
- Document Object Model
- Browser Object Model
1 ECMAScript
The ECMAScript defined by ECMA-262 has no dependencies on the Web browser. A Web browser is just one of the possible hosting environments for ECMAScript implementations. The hosting environment not only provides a basic ECMAScript implementation, but also provides an extension of the language for the interface between the language and the environment. 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 and Adobe Flash.
The ECMA-262 standard specifies the following components of the language:
- Grammar
- Type
- Statement
- Key words
- Reserved words
- Operator
- Object
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.
DOM level
The DOM1 class (DOM Level 1) became the recommended standard for the World Wide World of October 1998. The DOM1 level consists of two modules: the DOM core (DOM cores) and the Dom HTML. The DOM core specifies how to map an XML-based document structure while simplifying access and manipulation of any part of the document. Dom HTML modules are expanded on the basis of the DOM core, adding objects and methods to HTML.
Based on the original DOM, the DOM2 class also expands the subdivision modules such as mouse and user interface events, scopes, traversal (methods for iterating over DOM documents), and adds support for CSS (cascading style Sheets, cascading style sheets) through the object interface. The DOM core modules in the DOM1 class are also extended to support XML namespaces.
The DOM3 class extends the DOM further, introducing a way to load and save documents in a uniform way-defined in DOM load and save (DOM load and save) modules, and new methods for validating documents-defined in DOM validation (DOM Validation) modules. The DOM3 class also extends the DOM core, starting with the XML 1.0 specification and designing XML Infoset, XPath, and XML Base.
3 Browser object Model (BOM)
Developers use the BOM to control parts of the page that the browser displays. The BOM functionality is not written to the formal specification until HTML5.
[Notes] JavaScript Advanced Programming-JavaScript Introduction