Basic knowledge of web development Javascript_

Source: Internet
Author: User
Tags html tags logical operators reserved
Keng
The author thinks web development includes design html,javascript,css, and a kind of high-level language, such as C#,java and so on, this paper is divided into three parts, the first part is a simple introduction to JavaScript, the second part of understanding ECMAScript, The last part for JavaScript based, so the JavaScript writer is not very deep understanding, only from the following points to his analysis, if not, please point out, thank you! The main contents are:

The first part:

Javascript
Characteristics
The implementation of JavaScript
ECMAScript standard
The development of JavaScript

Part II:

About ECMAScript
1, the same syntax
2. Object-Oriented Programming
3, the function is also the object
4, the object has the prototype
5. Convenient data construction
6, JavaScript Object symbol (JSON)
7, Fifth Edition

Part III:
1. JavaScript syntax
2, variable
3. Data type
4, conditional statement
5. Circular statements
6. function
Reference

The first part:
JavaScript introduction
JavaScript is a scripting language that is object-based (object) and event-driven (driven) and has a secure performance. It is intended to be used with HTML Hypertext Markup Language, Java scripting language (Java applets) to link multiple objects in a Web page and interact with web customers. So that you can develop client applications, and so on. It is implemented in the standard HTML language by embedding or entering. Its appearance makes up for the weakness of the HTML language, which is the choice between Java and HTML compromise.
Features
is a scripting language
JavaScript is a scripting language that uses small program segments to implement programming. Like other scripting languages, JavaScript is also an interpretive language that provides an easy development process. Its basic structure form and C, C + +, VB, Delphi is very similar. But unlike these languages, it needs to be compiled first, and is interpreted step-by-step in the process of running a program. It is combined with HTML tags to facilitate user action. An object-based language. JavaScript is an object-based language that can be viewed as an object-oriented object. This means that it can use the objects that you have created. As a result, many features can be derived from the interaction of the methods and scripts of objects in the scripting environment.
of simplicity
The simplicity of JavaScript is mainly reflected in: first of all, it is a simple and compact design based on Java basic statements and control flow, which is a very good transition for learning java. Second, its variable type is weakly typed and does not use a strict data type.
Security
JavaScript is a security language that does not allow access to local hard disks, does not store data on the server, modifies and deletes network documents, and can only be accessed through browser or dynamic interaction. So as to effectively prevent the loss of data.
Dynamic nature of
JavaScript is dynamic and can respond directly to user or customer input without having to go through a Web service program. It responds to the user's response in an event-driven manner. Event-driven, which is the action generated by performing an action in the home page, is called an event. For example, press the mouse, move the window, select the menu, etc. can be considered as an event. When an event occurs, the corresponding event response may be caused.
Cross-platform nature
JavaScript is dependent on the browser itself, regardless of the operating environment, as long as the browser can run the computer, and support JavaScript browser to execute correctly. Thus realizing the "write once, all over the world" dream. In fact, the best thing about JavaScript is that you can do a lot of things with very small programs. No need for high-performance computers, software only need a word processing software and a browser, without the Web server channel, through their own computer can do everything.
Comprehensive
JavaScript is a new descriptive language that can be clamped into HTML files. The JavaScript language can respond to consumer needs events such as: form, instead of using any network to transmit data back and forth, so when a user enters a piece of data, it does not have to pass through to the server to process, then pass back the process, and directly by the client ( Client) are processed by the application.
JavaScript and Java are similar, but not the same! Java is a much more complex programming language than JavaScript, and JavaScript is a language that is fairly easy to understand. JavaScript creators can be less focused on programming skills, so many Java features are not supported in Java Script.
JavaScript implementation
The core of the core (ECMAScript)--javascript ECMAScript describes the syntax and basic objects of the language.
Document Object Model (DOM)--dom describes methods and interfaces for handling Web page content
Browser object Model (BOM)--bom describes methods and interfaces for interacting with browsers

ECMAScript Standard

In the 1997, the European Computer Manufacturers Association (ECMA) developed the ECMA-262 standard on the basis of JavaScript language specification, and formed the specification of Web script language. Currently, all major browsers support scripting languages that conform to the ECMA-262 standard. From then on, web browsers began to work (albeit with varying degrees of success and failure) to ECMAScript as a basis for JavaScript implementations. 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 consists of the following 3 different parts:
The core of the core (ECMAScript)--javascript ECMAScript describes the syntax and basic objects of the language.
Document Object Model (DOM)--dom describes methods and interfaces for handling Web page content
Browser object Model (BOM)--bom describes methods and interfaces for interacting with browsers
All of the current mainstream Web browsers support ECMA-262 Third Edition, JavaScript 1.5, JavaScript 1.6-1.9 is ECMAScript (JavaScript on Gecko) upgraded to JavaScript A temporary code number for 2.0.
The development trend of JavaScript

Language is always used as a tool, and it has never been changed, and it will never be, and language is the way and means of communicating with and with other technologies. For example, on the Windows platform, using the ADODB component enables JavaScript to handle data in a database that supports SQL, and uses the FSO component to implement local file IO capabilities. All of this explains that JavaScript is at the top of application development, and it has nothing to do with the implementation of low-level technologies.
Despite the changing platform technology, JavaScript will continue to use the platform's capabilities to accommodate new requirements in an unchanging fashion. For some time to come, web development will be a place for developers to get together and a time when JavaScript becomes mauve.

Part II:

About ECMAScript
ECMAScript is a standard scripting language (JAVASCRIPT) developed by ECMA (European Computer Manufacturers Association) and is currently recommended for ECMAScript 262 (http:// www.ecma.ch/ecma1/STAND/ECMA-262. HTM), first the ECMAScript specification describes the basic content that a scripting language should implement as follows: syntax, data and variable types, statements, keywords, reserved words, operator objects. So a scripting language that conforms to the ECMA-262 specification must implement all of the "types, values, objects, properties, functions, and program syntax and Semantics" described by 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 you can define new "program and Regular Expression syntax", and so on.
1, the same syntax
The first is the same syntax, ECMAScript is similar to other popular open languages like C#,java, which means that other language styles seem to want to be in ECMAScript, such as
Copy Code code as follows:

for (i = 0; i < a.length; i++) {
if (a[i] = = x)
return i;
}

2. Object-Oriented Programming
ECMAScript support for object-oriented programming. The value of the named property in the ECMAScript object. Object, a function can be called a method.
Window.settitle (User.Name);
3, the function is also the object
The function of ECMAScript is that objects and properties are passed as parameters, can be stored, and returned as results. From functional programming, let your function and method import functions get a simple and flexible way from their callers.
Copy Code code as follows:

var recent = Posts.sort (function (A, b) {
Return (A.date > B.date -1:1);
}). Slice (0, 10);

4, the object has the prototype
Inspired by its own programming language, ECMAScript objects inherit the properties of the prototype object, and the prototype based programming facilitates easy delegation and flexible coverage of object behavior.
Copy Code code as follows:

function car () {}
Car.prototype = new Object ();
Car.prototype.wheels = 4;
Car.prototype.color = "BLACK";
function racecar () {}
Racecar.prototype = new car ();
RaceCar.prototype.color = "Red";
var vroom = new racecar ();
Vroom.wheels//4
Vroom.color//"Red"

5. Convenient data construction
There are many common data types in ECMAScript that can save time and make your program easier to read shorthand.
Arrays
var digits = [3, 1, 4, 1, 5, 9];
Objects

var img = {width:320, height:160, src: "Images/es.png"};
Regular expressions

var email =/([^@]*) @ ([^@]*)/;
6, JavaScript object symbol (JSON)

JSON is a popular, lightweight format for data interchange. JSON is an interactive web and Web service, partly especially useful because its syntax is a subset of the ECMAScript syntax.

7, Fifth Edition
The European Computer Manufacturers Association recently released a draft of the final candidate for the fifth edition of the new ECMAScript standard. Some of the new features include:
1, improve the standard library
2, the standardized JSON library
3. Getter and setter methods for reflection

Part III:
1. JavaScript syntax
1.1 Case Sensitive
1.2 Weakness type variable
var myname= "Xinzhu"; var age =22;var school= "Gxnu"; var male=true; 1.3 A semicolon may be available at the end of each entry, but no
1.4 Brackets for Code blocks

Copy Code code as follows:

if (myname== "Xinzhu") {
var age=22;
alert (age);
}

1.5javascript annotation mode and C language, Java is the same
2, variable

Through the VAR keyword declaration, such as: Var boy= "Xinzhu"; here to note that the first character is a letter, can be case, underline and $, the rest can be underlined, $, arbitrary mother; variable names may not be keywords or reserved words

3. Data type
Underfined, represents an unknown thing, you can assign the underfined to any variable or attribute, but does not mean that the variable is cleared, but it will therefore have a more property
NULL, there's probably this concept, but nothing.
Boolean, yes, and non, for code processing and control code flow
Number, linear things, case and order, used for batch processing of code, can control code iterations or loops
String, for people's rational things, can be communicated by the human Computer information, the code can understand the human intent

4, conditional statement

Comparison operators, logical operators, if statements, switch statements, these will be very simple. No columns
5. Circular statements

For, while, too simple no columns
6. function
JavaScript code has only one form of function, which is the type of functions, the method used to complete an event
Format:
Copy Code code as follows:

function functionname ([arg0,arg1,arg2......argn]) {
Statements
[Returm[expression]]
}

Example:
Copy Code code as follows:

function SayHello (sname) {
Alert ("Hello" +sname);
}
Sayname (Xinzhu);//Call

Reference

1, March 2012 list of programming languages: The Return of JavaScript language (1)  
2, IT company interview manual
3, 4, ecmascript:http://www.ecmascript.org/index.php
5, proficient javascript.jquery

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.