JS scripting language:
This is the name of Jaxascript.
JS is the scripting language used within the Web page
JS is a very powerful language.
The basic syntax of JS
Comment Syntax: single-line comment//Multiline comment/**/
Output syntax: Double-label Formula:<script> formula content </script>
Alert ("message") formula content} This code is a popup message on the page
Confirm ("Information"); Formula content} This code pops up a dialog box that interacts with the user. There is {OK} {cancel}
Prompt ("information") formula content} This code pops up a dialog box that lets the user enter
Embed JS code:
General JS Code is at the bottom, so try to write down.
Formula format <script type= "Text/javascript" ></script>
Basic knowledge of the program:
JS all the characters are all English half-width
In the case of a large department, a semicolon is added after each statement ends;
After each piece of code, add a newline {carriage return} so that the code you enter looks neat and tidy.
The program echoes back and forth. Preceded by a parenthesis "(" There must be a parenthesis end after ")"
Data type: Data stored in a program, stored in a name called a variable
Strongly typed languages: data storage needs to exist in the corresponding data type variables
Weakly typed languages: non-differentiated types when data is stored (type auto-conversion)
Strong language code type:
Shaping (integer) int
Single-precision fractional float
Decimal doble with double precision
Fractional decimal
Uncommon type, currency type money
Character Char
Strings string
boolean bool True True false-false
Date Time Type datetime
Variable definition:
var a = 10;
If you define a decimal or integer variable, the value after the equal sign is written directly
If you define a string variable, the value after the equals sign needs double or single quotation marks
Type conversion: parseint
The
JavaScript program basic knowledge data type. {0912}