You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
744 B

3 months ago
## ECMAScript
### 基本语法
##### 语句:
`var num = 1;`
##### 引入文件:
1. 直接写
2. 引入本地文件
3. 引入网络来源
##### 数据类型
1. 数值
2. 字符串
3. 布尔
4. null
5. 对象
6. undefined
特别的 对象:
```javascript
var user{
age: 18,
name: 'sss',
}
```
##### 运算符
###### typeof
`console.log(typeof age);`
###### 三元/目运算符
`num % 2 === 0 ? console.log("偶数") : console.log("奇数");`
### 字符串
#### json
对象转为字符串
JSON.stringify(obj)
## BOM
浏览器对象模型
## DOM
文档对象模型
将html中所有元素都封装成一个对象采用面向对象的方式来对HTML进行操作
## 事件监听