Create the 1~4 section folder before creating the HTML file:
Section One: How JavaScript is introduced
First introduce the internal introduction of two methods: JS script in
JS script must be wrapped in <srcipt></script> inside: first included in head
Operation Result:
Contained inside the body:
Operation Result:
The next step is the external introduction method:
Create JS file in SEC01: Project right-new file
Inside write:
Next introduce Myjs.js:
Operation Result:
If garbled, the property's character property may be incorrect:
Can join: CharSet and properties of the encoding like, otherwise garbled. It is best to unify into UTF-8, garbled and modified code .
2. JavaScript Comments:
Single-line Comment://
Multiline Comment:/* */
3. JavaScript variables:
JavaScript is a weak language type and uses var to define variables (any).
Description: JS has a garbage collection mechanism, a from 1 into a string, then 1 will be destroyed immediately.
There is no type of strict meaning.
Define variables and assign values directly below:
4. JavaScript Basic Data type:
Strings Support "", "" (English input state) both can.
Next write the value, String, Boolean type:
Results:
Next comes the 2 special:
1, Undefined:
2. Empty the variable:
JavaScript basic syntax