Xiaoyin
The author believes that web development includes designing html, javascript, css, and a high-level language, such as c#, java, etc. This article is divided into three parts. The first part is a brief introduction to javascript, and the second part is understanding ECMAscript. The last part is the basics of JavaScript, so I don’t have a deep understanding of JavaScript. I can only analyze it from the following points. If it is wrong, please point it out, thank you! The main content is:
Part One :
javascript
Features
implementation of javascript
ECMAScript standard
development of javascript
Part 2:
About ECMAScript
1. Same syntax
2. Object-oriented programming
3. Functions are also objects
4. Objects have prototypes
5. Convenient data construction
6. JavaScript Object Notation (JSON)
7. Fifth Edition
Part 3:
1. JavaScript syntax
2. Variables
3. Data Type
4. Conditional statement
5. Loop statement
6. Function
Reference
Part One:
Introduction to JavaScript
JavaScript is A scripting language based on Object and Event Driven with security features. The purpose of using it is to work with HTML hypertext markup language and Java script language (Java applet) to link multiple objects in a Web page and interact with Web clients. This allows you to develop client applications, etc. It is implemented in the standard HTML language by embedding or calling in. Its appearance makes up for the shortcomings of the HTML language, and it is a compromise between Java and HTML.
Features
is a scripting language
JavaScript is a scripting language that uses Programming is implemented in the form of small program segments. Like other scripting languages, JavaScript is also an interpreted language, which provides an easy development process. Its basic structural form is very similar to C, C++, VB, and Delphi. But it does not need to be compiled first like these languages, but is interpreted line by line during the running of the program. It is combined with HTML tags to facilitate user operations. Object-based language. JavaScript is an object-based language and can be considered an object-oriented language. This means that it can use objects it has already created. Therefore, much functionality can come from the interaction of methods of objects in a scripting environment with scripts.
Simplicity
The simplicity of JavaScript is mainly reflected in: First of all, it is a simple and compact design based on Java's basic statements and control flow, which is a very good transition for learning Java. Secondly, its variable type is weakly typed and does not use strict data types.
Security
JavaScript is a security language. It does not allow access to the local hard drive, cannot store data on the server, and does not allow modification and deletion of network documents. It can only be implemented through the browser. Information browsing or dynamic interaction. This effectively prevents data loss.
Dynamic
JavaScript is dynamic, it can respond directly to user or customer input without going through a Web service program. It responds to users in an event-driven manner. The so-called event-driven refers to the action generated by performing a certain operation on the home page, which is called an "event". For example, pressing the mouse, moving the window, selecting the menu, etc. can be regarded as events. When an event occurs, a corresponding event response may be triggered.
Cross-platform
JavaScript depends on the browser itself and has nothing to do with the operating environment. As long as the computer can run the browser and the browser supports JavaScript, it can be executed correctly. Thus realizing the dream of "write once and travel all over the world". In fact, the most outstanding thing about JavaScript is that it can do a lot of things with a small program. There is no need for a high-performance computer. The software only requires a word processing software and a browser. There is no need for a WEB server channel. Everything can be done through your own computer.
Comprehensive
JavaScript is a new description language that can be clamped into HTML files. The JavaScript language can respond to user demand events (such as form input) without using any network to transmit data back and forth. Therefore, when a user inputs a piece of data, it does not need to be passed to the server. ) processing and then passing it back can be directly processed by the client application.
JavaScript and Java are very similar, but they are not the same! Java is a much more complex programming language than JavaScript, while JavaScript is a fairly easy language to understand. JavaScript creators can be less focused on programming skills, so many Java features are not supported in Java Script.
JavaScript Implementation
Core (ECMAScript) - The core of JavaScript ECMAScript describes the syntax and basic objects of the language
Document Object Model (DOM) - DOM describes the methods and interfaces for processing web content
Browser Object Model (BOM) - BOM describes the methods and interfaces for interacting with the browser
ECMAScript standard
1997, European Computer Manufacturers Association (ECMA) formulated the ECMA-262 standard based on the JavaScript language specification, forming a specification for web scripting language.Currently, all major browsers support scripting languages that comply with the ECMA-262 standard. Since then, web browsers have worked hard (albeit with varying degrees of success and failure) to use ECMAScript as the basis for JavaScript implementation. Although ECMAScript is an important standard, it is not the only part of JavaScript, and certainly not the only part that is standardized. In fact, a complete JavaScript implementation is composed of the following 3 different parts:
Core (ECMAScript) - the core of JavaScript ECMAScript describes the syntax and basic objects of the language
Document Object Model (DOM) - —DOM describes the methods and interfaces for processing web content
Browser Object Model (BOM) — BOM describes the methods and interfaces for interacting with the browser
All current mainstream web browsers support ECMA-262 The third edition, JavaScript 1.5, JavaScript 1.6-1.9 is just the temporary code name for the upgrade of ECMAScript (JavaScript on Gecko) to JavaScript 2.0.
Development Trend of JavaScript
Language will always be used as a tool. This has never been changed and will never be changed in the future. Language is the way and means to use and communicate with other technologies. For example, on the Windows platform, the ADODB component can be used to enable JavaScript to process data in a database that supports SQL, and the FSO component can be used to implement local file IO functions. All this shows that JavaScript is at the top of application development and has nothing to do with the implementation of low-level technologies.
Although platform technology continues to change, JavaScript will still use the capabilities provided by the platform in an unchanged form to adapt to new needs. In the future, Web development will be a gathering place for developers, and it will also be an era when JavaScript becomes purple.
Part 2:
About ECMAScript
ECMAScript is a standard scripting language (JAVAScript) developed by ECMA (European Computer Manufacturers Association). It is currently recommended to follow ECMAScript 262 (http://www.ecma.ch/ecma1/STAND/ECMA-262.HTM), first of all, the ECMAScript specification describes the basic contents that a script programming language should implement as follows: syntax, data and variable types, statements, keys Words, reserved words, operator objects. Therefore, a script programming language that complies with the ECMA-262 specification must implement all "types, values, objects, properties, functions, and program syntax and semantics" described in the specification, and must support the Unicode Character Standard (UCS). On this basis, each specific implementation can also specify "additional types, values, objects, properties, and functions", and can define new "programs and regular expression syntaxes", etc.
1. The same syntax
First of all, the same syntax. ECMAScript is very similar to other popular open languages such as c# and java, which means that other language styles seem to want to be used in it. On ECMAScript, for example,
1. March 2012 Programming Language Ranking: The Return of JavaScript Language (1)
2. IT Company Interview Manual
3. Standard ECMA-262: http://www.ecma-international.org/publications/standards/Ecma-262-arch.htm
4. ecmascript: http://www.ecmascript.org/index.php
5. 《Mastering JavaScript.jQuery》