Java Script Basics (i)

Source: Internet
Author: User

Java Script Basics (i)

First, why learn JavaScript

There are two main reasons for learning JavaScript.

1. Client form validation.

2. Achieve page interaction (web effects)

Second, what is JavaScript

JavaScript is a descriptive language, a security-friendly script that is based on object and event-driven (driven). It runs on the client side, thereby alleviating the burden of Wu's blessing. Its characteristics are as follows:

1. JavaScript is used primarily to add interactive behavior to HTML pages.

2. JavaScript is used primarily to add interactive behavior to HTML pages.

3, JavaScript is generally used to write client script.

4, JavaScript is an explanatory language, the side of the execution side interpretation.

Third, the composition of JavaScript.

A complete JavaScript consists of 3 different parts of the core syntax (ECMAScript), the browser object model (BOM), and the Document Object Model (DOM).

Iv. basic JavaScript syntax

<script type= "Text/javascript" >

<!--

JavaScript statements

-

</script>

Description

<script></script>: Represents a script tag, JavaScript script must be written in the script tag.

<!--statement-->: is a comment tag that tells browsers that do not support JavaScript to ignore the JavaScript code contained in the tag.

Type: property indicates that the language category used is JavaScript.

V. How JavaScript scripts are referenced in the page

JavaScript is embedded in a Web page as a script there are 3 ways:

1, use <script></script> label.

2. Use external. js file.

3, write directly in the HTML file.

Java Script Basics (i)

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.