First of all, an outline of the outline
- jsCore grammar
- Basic grammar
- Keywords, reserved words, annotations
- data structure
The first thing to be sure is that JS is not edible. He is a scripting language.
We see that most of the dynamic effects on the page are implemented by JS. For example, the left and right scroll of a picture, such as clicking a button, such as clicking a login button, will bring out a floating layer. These are all implemented by JS.
The display concealment for the floating layer is that JS controls the display attribute pair of the floating layer, and the picture scroll is also implemented by dynamically modifying the attributes of the picture by JS. So we say that part of JS’s work is to dynamically change the properties of HTML elements to achieve some dynamic effects.For example, through Ajax technology to communicate with the server and so on.
After understanding what JS can do, we will get a brief understanding of the history of JS.
When I did not have JS at that time, for example, I want to do a login operation, after the input account password submission is to send to the server to judge whether the password you entered is correct, it needs to wait a few seconds, the server feedback to you to say that a place is wrong, this process is to make people crumble.Yes.
So Netscape (Netscape), which was at the forefront of technological innovation, decided to start developing a client language to deal with this simple form of form validation. At that time, Brandon Edge Eich, who was working in Netscape company, was received by Brendan.This task allows him to do a scripting language that can perform simple web page form validation.
ECMA-262standard —— It defines a new script language standard called ECMAScript. That is to say, all browsers must support ECMA standards. This way, programmers can be compatible with all browsers if they are written according to ECMA standard.
1997In the year, ES1.0 was first launched, and the next year was 2.
8 years later, 8 years later, 8 years later, the draft of the ES was published, in which the syntax of the ES4.0 was greatly modified, but because the program was too radical, there was a serious disagreement in the industry. After a long discussion, the ECMA Association finally decided to abolish the ES4.0 of the draft. In 2009, another relatively minor version of the scheme was issued, called ES3.1 version, also called ES5.
Later, in 2015, ES6 was officially released. Although the amendment was also very radical, it was finally approved by the Committee. Later, ECMA modified this non rhythmic publishing mode, and changed it to a version in one year, and ES6 was renamed to ES2015.
Besides, we talked about the development of JS. Let’s go back to the theme and see the composition of JS.
- The core (ECMAScript)
- Document object model (DOM)
- Browser object model (BOM)
In the JS implementation of browser side, ECMA specifies the core syntax, such as data type, statement, keyword, reserved word, operator, object, etc. The related parts of DOM and BOM are unique in browser environment. In the web page, the HTML page will be parsed into a DOM tree combined with C.The SS stylesheet is rendered on the page, and the DOM related part is to operate the DOM tree. Such a simple page, for example:
<html> <head> <title>Sample Page</title> </head> <body> <p>Hello World!</p> </body> </html>
It will be parsed in this way
We can easily delete, add and modify any of the nodes through the API provided by DOM.
BOMBrowser object model, as its name implies, provides some API related to browsers.
BOMIt’s not necessarily a part of it.
In addition, only ECMAScript is standard in JS implementation, so only ECMAScript part is the same in all browsers. however
BOMPartly because there are no standards, the implementation of browser vendors is not nearly the same.
So we say that ECMAScript basically does not need to be compatible. Part of DOM needs to be compatible. Most of BOM needs compatible processing. But as time goes on, the popularity of standard browsers and the elimination of low version browsers will lead to more and more standards and consensus.
In addition, if you have any questions in the process of learning the front end and want to consult me on the public number of LearnInPro, we will respond to every question in a timely and serious way. It