JavaScript is a scripting language based on the ECMAScript specification, and it's built on its own encapsulation. It is worth saying that ECMAScript is not a programming language, it is just a scripting language specification developed and published by the European Computer Association.
In addition to JavaScript, ActionScript (Flash), JScript (Microsoft) are based on the ECMAScript specification.
First, let's look at the composition of javascript:
- ECMAScript (CORE): The basis of JavaScript
- DOM (Document Object model): Document objects module, which specifies an interface for accessing HTML and XML
- BOM (Browser object model): Browser object models, which provide objects and methods that are independent of content and exchanged between browser windows
1. ECMAScript
ECMAScript the core syntax for JavaScript, which includes basic data types, reserved words, keywords, operators, objects, and so forth. He doesn't belong to any browser.
2. DOM
The DOM is the abbreviation for "Document Object Model", which is the documentation object models, which are customized by the audience.
The DOM defines an interface for manipulating HTML documents, providing access to HTML documents and how to do so.
After the browser loads the HTML document, it plans the entire document into a node tree that is composed of nodes.
1 <div class= "id" id= "class" >dom (Document Object Model) </div>
3. BOM
The BOM is the abbreviation for the "Browser object Model", which is the browser object models. Unfortunately, the BOM is only a ECMAScript expansion, and there is no relevant norms, the Internet has not made the corresponding specifications, each browser manufacturer has a set of its own BOM standards.
The BOM defines the interface of the operating browser, providing access to certain functions (e.g. browser window size, browsing history, etc.) and how to do so.
Main functions of BOM:
- Pop up a new browser window
- Move, close, and resize the browser window
- Navigation objects for Web browser details
- Local object that the browser loads the page details into
- Screen object for user resolution details
- Support Cookies
- IE has extended the ActiveX object class to the BOM, and can implement the ActiveX object through JavaScript.
4. The composition of JavaScript