Chapter Javasript Introduction to the first section
1. What is JavaScript?
An object-oriented, interpretive programming language.
Features of the 2.JavaScript.
- Loose sex
- Object Properties
- Inheritance mechanism (prototype based)
3.JavaScript Core
- Core (ECMAScript)
- Document Object Model (DOM)
- Browser object Model (BOM)
Chapter II using JavaScript
1. Create an HTML page
<!DOCTYPE HTML><HTMLLang= "en"><Head><MetaCharSet= "Utf-8"/><title>The first page</title></Head><Body><H1>Hello World</H1></Body></HTML>
2.<script> Label parsing
- Defer----Specifies whether to defer execution of the script until the page loads.
- SRC----Specifies the URL of the external script file.
- Type----Specifies the MIME type of the script.
- CharSet----Defines the character encoding used in the script. Not supported.
Some problems with 3.JS code embedding
Smooth degradation, JavaScript not supported
< NoScript > You do not have JavaScript enabled. </ NoScript >
Chapter III syntax, keyword reserved words and variables
1. Grammatical composition
- Case sensitive
- Identifiers: Variables, functions, names of properties, or parameters of a function
- Comments//Single Line/* * * Multiple lines
- Direct volume (literal)
- Expressions for array literals and object literals are also supported by {x:1,y:2},{1,2,3,4,5}
2. Keywords and reserved words
3. Variables
Fourth Chapter data types
Simple data types: Undefined,null,boolean,number and string
Complex data type: Object
1.typeof operator
- objects or null----object
- Functions------function (not data type)
2.Undefined type
- There is only one value, that is, the special undefined
- Declaring a variable with VAR, but not initializing it
- It is not necessary to assign a variable to undefined
3.Null type
- There is only one value, that is, the special null
- It represents an empty object reference (pointer)
- If you define variables to be used in the future to save objects, it is best to initialize
- Undefined is derived from Null,alert (undefined==null)//true
4.Boolean type
A Boolean value of false for the following conditions
- Empty string
- 0 and Nan
- Null
- Undefined
5.Number type
Floating-point range
Number.min_value~~~number.max_value
- Alert (IsNaN (NaN))---True
- Alert (number (TRUE))---1
- Alert (number (NULL))---0
- Alert (number (undefined))----false
JavaScript Advanced Programming--01