First, usage
Its location has three pieces, 1, head inside 2, body inside 3,
Its usage is <script></script>
Two or three common dialog boxes
1. Alert ("") warning dialog box only OK and close
2, confirm ("") Ok dialog box has OK button and cancel and close
3, Prompt ("") Pop up a dialog box that can enter text
Third, JS syntax
1. Basic Data type
String, Decimal, Integer, date, Boolean
2. Variables
Variables are usually defined with Var, such as Var year= ""
3. Type conversion
parsefloat () force conversion to decimal
parseint () Forced conversion to an integer
IsNaN () determines whether a valid number type is a number if the return flase is not a number then returns True
Iv. operators
1, Mathematical operations: + (and the meaning of stitching)-*/% (except for the commercial surplus) + +--
2, relational operators: = =! = = = =<
3. Logical operator:&& (with) | | (OR)! Non-
4. Other operators: A+=b (A=A+B)
V. Branch statements
1. if ()
{
Need to execute statement
}
2. if ()
{
Need to execute statement}
Else
{
The rest of the execution statements that do not meet the criteria}
3. if ()
{
Execution that satisfies the condition}
else if ()
{Meet Condition execution}
Else
{
Condition execution Not satisfied}
4, if inlay: After the scope of the specification, what is the small situation need to judge the use
JavaScript syntax, dialog box. Branch statements