The first section of singles' Javascript interpretation in 2014: Singles' Day in 2014

Source: Internet
Author: User

The first section of singles' Javascript interpretation in 2014: Singles' Day in 2014

***************

1. javascript is a prototype inherited object-based Dynamic scripting language. It is case-sensitive and runs on the client, even if the user responds to the user's operations and performs data parsing and transmission.

2. Javascript does not have much to do with Java, but the name is repeated with four letters.

3. The main function of Javascript is to perform data verification, provide special webpage effects, and dynamically respond to user operations. Javascript and Ajax are also mentioned.

* ************ History of Javascript ***********

1. Its predecessor was LiveScript, which was first put into use in the Netscape browser in 1995.

2. After Microsoft's involvement in the browser market, the Front-End scripting language in the market became three-pronged, and the Front-End scripting became very messy. Therefore, it was time to develop a standard.

In 3.1997, Javascript1.1 was submitted to ECMA. Later, the International Organization for Standardization and the International Electrotechnical Commission adopted the proposal. Therefore, it became a de facto standard, but its name was ECMAScript.

4. A complete Javascript consists of the following three parts: the core part (ECMAScript), the Document Object Model (DOM), and the browser Object Model (BOM ).

* *********** The first Javascript program ***********

1. I know that many people start learning programming from helloworld, and we will start from this classic helloworld.

2. Create an html file, open it in the editor, and write the following code:

<Html> 

3. After saving the file, open it in the browser and click "Xin Xing". A dialog box is displayed, with ten words "Hello world" written on it ".

4. as you can see from the above example, we use the Javascript code directly embedded into the html file. Of course, you can also write it separately, then, the html file is used to import the Javascript file.

5. Some old browsers may need to add type = "text/javascript" to scripts, but they are no longer needed. modern browsers and HTML5 use Javascript by default.

6. We have defined a Javascript function, which is defined using the function. Other functions are similar to other programming languages, and the syntax is similar to Java.

7. we have a Button in the body tag. Its function is to trigger certain events when you click the Button, that is, to call certain functions. The function here is the function xin in our script.

 

* ************** Where to write Javascript *******

1. We have written it in the head label. In fact, we can also write it in the body label.

2. Check the following code:

<Html> 

3. Just like importing a css file, we can import Javascript files in a similar way. For example, if we create an HTML file, the Code is as follows:

<Html> 

Then we create a new my. js file in the same directory. The content is as follows:

Function xin () {alert ("xin Xing ");}

Then, we save the html file and run it. When we click "Xin Xing", a "Xin Xing" dialog box is displayed.

4. Remember that you can directly write js code in the introduced js file without any additional labels.

 

*************

1. This section describes the basic knowledge of Javascript.

2. Then we started the first js program and explained the position of writing JavaScript code.




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.