JS scripting language (full name Java script: scripting language used in Web pages: very powerful language): basic syntax

Source: Internet
Author: User
Tags true true
One. Comment syntax

1. Single-line comment//

2. Multi-line Comment/**/

Two. Syntax output

1.alert (Info): Popup information

2.confirm (info): Pop Up a dialog box with user interaction

3.prompt (info): POPs up a dialog box for the user to enter

Three. Embed code

1. Write down as much as possible

2.<script style= "Textjavasprit" ></script>

Four. Basic knowledge of the program

1. All characters are in English half-width

2. In most cases, a semicolon is added after the end of each statement

3. Line breaks after each piece of code ends

4. Pre-and post-process echoes (preceded by a parenthesis "(must have a parenthesis end)")

Five. Data type

1. The data is stored in the program, and the stored name is called a variable

2. Data storage needs to exist in the corresponding data type variables: strongly typed language

3. The data is stored in a non-differentiated type (type auto-conversion): Weakly typed language

5. Type: (integer) int, (single-precision decimal float), (decimal number Double), (decimal: decimal), (currency type money), (character char), (string literal), (Boolean bool:true true). False), (date Time type datetime)

6. Variable definition: var:a=10; (if a variable with a decimal or an integer is defined, the value after the equal sign is written directly) (if you define a string variable, the value after the equals sign needs to be double or single quotation marks)

7. Type conversion: parseint

8. Operator Expressions:

JS scripting language (full name Java script: scripting language used in Web pages: very powerful language): basic syntax

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.