An article about the relationship between JavaScript and ECMAScript

青灯夜游
Release: 2020-07-06 10:20:46
forward
1863 people have browsed it

An article about the relationship between JavaScript and ECMAScript

JS and ES

Every student who studies JS has heard of ES5 and ES6, but have all the students cleared it? Do you know the relationship between them? We usually think that these two are the same thing. In fact, their relationship is as follows:

From the above figure, we can clearly see that they are not a parallel relationship, but an inclusive relationship, so the following is Let me introduce the

ECMAScript

core respectively. It does not have input and output definitions, and there is no dependency between this language and the browser. The browser only provides the language hosting environment, as well as the implementation of the language and some localized extensions.

Since the browser is the host environment, there are other host environments: such as Node, such as Adobe Flash

ECMAScript stipulates this language:

  • Grammar
  • Type
  • Statement
  • Keyword
  • Reserved word
  • Operator
  • Object

This means that we can also write a language as an implementation of ECMAScript, just like JavaScript. We only need to:

  • Support all types of value object attribute functions described by ECMAScript As well as program syntax and semantics
  • Support Unicode

Note:

  • JSON objects are supported by native ECMAScript

DOM Document Object Model

In the browser, DOM implemented based on ECMAScript has become an important part of the JS language
DOM is described through HTML, a tree of page elements The structure object is the following thing:
An article about the relationship between JavaScript and ECMAScript
We need to pay attention to the following concepts:

  • DOM is a standard, which specifies how to use HTML to Mapping objects to simplify the operation of each node expressed in HTML
  • The relationship between ECMAScript and DOM is: the browser implements the DOM standard in a language that conforms to the ECMAScript standard
  • You can use other Language implementation DOM

DOM stipulates the following things:

  • HTML mapping objects, object operations
  • Mouse, user events, etc.
  • CSS style interface
  • Interface for traversing the document tree

BOM browser object model

The DOM object is in the page, using HTML The mapping of written elements, and the BOM object is the mapping of the browser object. Through the BOM, we can and are not limited to the following things:

  • Pop up a new window
  • Move Zoom and close the browser
  • Support cookies
  • Get the window or navigator object

The current BOM standard is only available in HTML5, so in each browser before The support for BOM functions is different. With HTML5, BOM will be truly unified one day in the future.

ES6

  • ES6 has been officially released in June 2015

  • Various websites for ES6 The level of syntax support is different

  • If you need to check the host environment's support for ES6, you can use the tool

  • If you need to check the browser's support for ES6, you can visit the web page
  • If you don’t want to face the problem of ES6 compatibility in different host environments, you can use the ES6 to ES5 converter Babel or Traceur

Recommended related tutorials:JavaScriptVideoTutorial

The above is the detailed content of An article about the relationship between JavaScript and ECMAScript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!