Home >Web Front-end >JS Tutorial >What are the three major components of JavaScript?

What are the three major components of JavaScript?

王林
王林Original
2020-11-13 11:00:5714855browse

The three major components of JavaScript are: 1. ECMAscript; 2. Document Object Model DOM; 3. Browser Object Model BOM. Among them, ECMAscript is the core of JavaScript and describes the basic syntax and data types of the language.

What are the three major components of JavaScript?

The three major components of JavaScript are:

1. ECMAScript: The core of JavaScript, which describes the basic syntax of the language (var, for , if, array, etc.) and data types (number, string, boolean, function, object (obj, [], {}, null), undefined), ECMAScript is a set of standards that defines a language (such as JS ) looks like.

(Learning video sharing: javascript video tutorial)

2. Document Object Model (DOM): DOM (Document Object Model) is the application programming interface of HTML and XML (API). DOM will lay out the entire page into a document composed of node hierarchies. Each part of an HTML or XML page is a derivative of a node. Consider the following HTML page:

<html>
  <head>
    <title>Sample Page</title>
  </head>
  <body>
    <p>hello world!</p>
  </body>
</html>

DOM represents a document by creating a tree, giving developers unprecedented control over the content and structure of the document. Nodes can be easily removed, added and replaced using the DOM API (getElementById, childNodes, appendChild, innerHTML).

3. Browser Object Model (BOM)

Access and operate the browser window. For example, popping up a new browser window, moving, changing and closing the browser window, providing detailed web browser information (navigator object), detailed page information (location object), detailed user screen resolution information (screen object) , support for cookies, etc.

As a part of JavaScript, BOM does not have the support of relevant standards. Each browser has its own implementation. Although there are some non-de facto standards, it still brings certain troubles to developers.

Related recommendations: js tutorial

The above is the detailed content of What are the three major components of JavaScript?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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