5.28 JS Basic Introduction

Source: Internet
Author: User

The Web front end has three layers:

    • HTML: Describing the structure of a page from a semantic perspective

    • CSS: From an aesthetic perspective, describe the style (beautify the page)

    • JavaScript: Describing behavior from an interactive perspective (improving the user experience)

JavaScript History Background Introduction

Brandon? IKE (Brendan eich,1961 years ~), 1995 at Netscape, invented the JavaScript.

At first JavaScript was called LiveScript, but because of the Java language was particularly hot, so in order to get big, renamed to JavaScript. Like the "Peking University" and "Beida Bird" relationship. "Beida Jade Bird" is beside "Peking University" big brand.

There were other web languages, such as VBScript, JScript, and so on, but they were all defeated by JavaScript, so now in the browser, only one scripting language is JavaScript.

The relationship between JavaScript and ECMAScript

ECMAScript is a standard developed by ECMA International (formerly the European Association of Computer manufacturers, the English name is European Computer Manufacturers Association).

JavaScript is developed by the company, and the problem is that it is inconvenient for other companies to expand and use. So the European ECMA Organization, led the development of JavaScript standards, named ECMAScript.

In simple terms,ECMAScript is not a language, but a standard . The more common criteria are: JavaScript, Action Script (the language in Flash). That is, your JavaScript is finished, and the program in Flash is a breeze.

ECMAScript in June 2015, the release of the ECMAScript 6, the language of the ability to be more powerful (also contains a lot of new features). However, the browser vendors are not able to catch up with this standard so quickly.

Development of javascript: thriving

http://2004.sina.com.cn/

http://2008.sina.com.cn/

http://2012.sina.com.cn/

The above three sites can feel the development of web technology.

Before 2003, JavaScript was considered "cowhide fresh", used to make ads on the page, pop-up windows, floating ads. What's annoying and what JavaScript is developing. So the browser has launched a blocking advertising function.

2004, the fate of JavaScript began to change, that year, Google began to take the lead in the use of Ajax technology , Ajax technology is an application of JavaScript. And that's when people gradually started to improve their user experience. Ajax has some application scenarios. For example, when we search for text in Baidu box, the input box below the smart hint, can be implemented through Ajax. For example, when we sign up for NetEase mailbox, we can find out whether the user name is occupied in time, instead of being transferred to another page.

In 2007, when Steve Jobs released his first iphone, the year began with users surfing the web using mobile devices.
JavaScript is also indispensable in mobile pages . And this year, the Internet began to standardize, according to the rules of the three-tier separation, JavaScript is becoming more and more important.

In 2010, people learned more about HTML5 technology , andHTML5 introduced a thing calledcanvas, which engineers can play on canvas, using JavaScript.

In 2011,node. JS was born , enabling JavaScript to develop server programs.

Today,WebApp is already very popular, is to use Web technology to develop mobile phone applications . Mobile phone system has iOS, Android. For example, the company to develop a "Ctrip" App, you need to recruit three teams, such as iOS engineers 10 people, 10 Android engineers, front-end engineers 10 people. A total of 30 people, the development costs, and if the revision, to change the 3 version. Now, assuming companies are using web technology, they can develop apps with Html+css+javascript technology. It's also easy to iterate (the page changes and all the terminals change).

Although the WebApp experience is far less functional and performance than the native app, "WebApp slowly replaces the native app" is likely to be a future trend.

JavaScript Primer Easy to learn
    • JavaScript is more friendly to beginners.

    • JavaScript has an interface effect (for example, the C language has only black characters on the white background).

    • JavaScript is a language of weakly variable types , and variables only need to be declared with Var. The declaration of variables in Java is defined according to the type of the variable.

For example, in Java you need to define the following variables:

    int A;    float A;    Double A;    String A;    Boolean A;

In JavaScript, you define only one variable:

   var A;
    • JavaScript does not care about other things (such as memory release, pointers, etc.) and is more concerned about its business.
JavaScript is the foreground language

JavaScript is the foreground language, not the background language.

JavaScript runs on the user's Terminal page, not on the server, so we call it the " foreground language ". JavaScript is a simple production page effect of the language, is to serve the interactive effect of the page, landscaping, gorgeous, unable to manipulate the database.

Background Language is running on the server, such as PHP, ASP, JSP and so on, these languages are able to operate the database, can be the database to "delete and change" operation. Except for node. js.

The composition of JavaScript

The JavaScript base is divided into three parts:

    • The grammatical standard of ecmascript:javascript. Includes variables, expressions, operators, functions, if statements, for statements, and so on.

    • DOM: An API that operates on elements on a Web page . For example, let the box move, color change, Carousel diagram and so on.

    • BOM: An API for manipulating browser-part functionality . For example, let the browser automatically scroll.

PS:JS mechanical repetitive labor almost 0, basically is creative labor. And unlike HTML, CSS in the margin, padding are mechanical repetitive labor.

Features of JavaScript

(1) Easy to use: can be written with any text editing tools, only the browser can execute the program.

(2) Interpretation Execution ( interpretation language ): Do not compile, line-by-row execution, without strict variable declaration.

(3) Object-based: Built in a large number of ready-made objects, writing a small number of programs can accomplish goals

5.28 JS Basic Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.