Article From:https://www.cnblogs.com/learninpro/p/9125258.html

 

 

For students who have just come into contact with the front-end development or just start learning JavaScript, what can JS do, how it is born, what its composition is, and there may be only a few vague concepts on these issues,jsAn introductory chapter It is hoped that we can talk about the JavaScript language from 0, and let the students who have just started to have a clearer and deeper understanding of it.

 

First of all, an outline of the outline

  • javascriptCan you eat it?
  • javascriptThe birth history.
  • javascriptComposition.
  • jsCore grammar
    • Basic grammar
    • Keywords, reserved words, annotations
    • variable
    • data structure
    • Event

One, JavaScript can you eat it

 

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.

And let’s throw aside the browser’s box, and we’ll find that with the rapid development of JavaScript in recent years, many companies are starting to use nodejs to write the server side, and the core is JS. And JS is increasingly being applied to app applications, desktop applications, and TV sets.The box interface, even VR applications, artificial intelligence, machine learning and other fields. The wide application of JS is difficult to match in other languages.

 

Two, the history of the birth of JavaScript

 

After understanding what JS can do, we will get a brief understanding of the history of JS.

JavaScriptBorn in 1995, most users at that time were using modem to connect to their home’s fixed line through internet cable. The speed is quite slow, and it takes patience to open a page every time.

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.

This is the great God. It was said that the guy didn’t like the task at the time, and it took him 10 days to get the job out. Well, this script language was originally called LiveScript, but thought the language of java was very popular at that time. In order to increase the influence, Netscape Co was in the process.When the language was released, it was temporarily changed to JavaScript. This is the process of the birth of the JS language.

Later, with the great success of JavaScript 1, other companies, such as Microsoft, also implemented a similar script language called JScript. Later, each family had its own way of implementation, which led to a problem when developers were making pages.It needs to be compatible with a variety of browsers. For example, you need to use JScript in IE browser, and use JavaScript in Netscape browser. Later, with the increasing problem, the standardization of JavaScript was finally put on the agenda.

1997In the year, the JavaScript1.1 – based proposal was submitted to the ECMA (European Computer Manufactures Association) after several months of effort.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.

 

The composition of three, JavaScript

As we have just said, because of the ECMA-262 standard, JavaScript is unified, so some people later used Javascript and ECMAScript to express the same meaning. ECMAScript for short, ES, maybe you’ve heard of itES5, ES6… The numbers behind these nouns represent the version of ES.

1997In the year, ES1.0 was first launched, and the next year was 2.

By December 1999, ES3.0 was published, after 2 years of improvement and effort, ES3.0’s grammar has been perfected. It has become the standard of JavaScript, and has been widely supported by the browser manufacturers. After a long time, the version of ES has not changed.Yes.

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.

  1. The core (ECMAScript)
  2. Document object model (DOM)
  3. 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.

With the rapid development of JavaScript in recent years, JavaScript has been able to run away from the browser’s Sandbox in other environments. But no matter what circumstances JS runs, he must use the ECMAScript part.DOMBOMIt’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. howeverDOMBOMPartly 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.

 

This article first lets you have a general understanding of JS. In the next chapter, we begin to start from the core syntax of JS and take you deep to explore all aspects of Javascript.

 

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

 
 

 

Similar Posts:

Link of this Article: JavaScript introductory course (1)

Leave a Reply

Your email address will not be published. Required fields are marked *