Day6 JS (JavaScript)

Source: Internet
Author: User

Usage of 1.JS

In HTML, his position is three places, after Head,body and

<script type= "Text/javascript" > code written on the inside </script>.

2. Three common dialog boxes

Alert ("") alert box, the function is to pop up a warning box

Confirm ("") Select the dialog box, the function is to pop up a selection dialog Click OK to return True, click Cancel to return to Flase.

Prompt ("", "") Pop up a dialog box that can input content, the first quotation mark inside the hint text to display, the second inside the input box and the contents of the hint (such as).

Syntax for 3.js

1 Basic data types are: String, Decimal, Integer, DateTime, Boolean, etc.

2 generally has a generic type of Var, which can store other types at will. You can use it to define variable var a=

3 Type conversions: There are casts and automatic conversions, which are generally cast.

Integer type parseint ()

Decimal Type parsefloat ()

In addition, there are character atring, double-precision doubles, single-precision flot, etc.

4 Judging is not a valid number type IsNaN ()

5 operator

Math operator +,-, *,/,++,--

Relational operator = =,!, >=,<=>,=

Logical operator &&,| |,!

Other operators +=,-+,*=,/=,%,? (A+=b equals A=a+b)

Day6 JS (JavaScript)

Related Article

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.