JavaScript: scripting language to parse and executed by the browser
Use JavaScript code
1. The wording inner row handles
2. The internal stylesheet <script> js Code </ Script>
3. Waibuyangshibiao <script src = "js end the path of the file .js"> </ Script>
4. External introducing external style import module
JavaScript code is part of the
basic core syntax
variables: the amount will become
defined variables
var keyword to define variables
var variable name = variable value;
naming the variable name: only letters, numbers, _, $ can not start with a number, not JavaScript is keywords and reserved words
in JavaScript is strictly case sensitive.
var B2
var B2
var a = 123; // in a programming language, a = number for assignment, showing two == Analyzing
the data type
of the original data type
number string boolean undefined null
string of numbers Boolean undefined null
reference data types
Object object
JavaScript the operational
addition:
1. Any type with string concatenation, are strings splice
2. The number and type Boolean, implicit conversion. True converted into a converted 1.false 0
3. numeric type and not the type of operation (except string Boolean). NAN adding unsuccessful appears
NAN (not a number) is not a number, but it is attributed to the type number
Subtraction:
1. Can Save Save would not subtracted NaN3
2. energy subtraction: boolean, string comparison when the particular time (time string all numbers)
multiplication:
Referring subtraction
division:
reference subtraction
Data Type: no concept of shaping and float here only numeric argument
Yu:
Reference subtraction
Comparison operation
Greater than> greater than or equal to> = Less than <, less than or equal to <=, == is equal to, not equal to! == === equal whole, is not identical! ==
After completion of these comparisons will only come out boolean boolean
logic operation
And: Only when all is true when it is true
Or: at least one of the time it is true true
Non-: negated
Bomb block: playing box is built inside a JavaScript function.
alert: alert box
prompt: Enter the pop-up prompt box first parameter represents the contents of the second parameter indicates the default content input box
confirm: Cancel the pop-up box