Skip to content

Commit 215d385

Browse files
committed
04-06
1 parent 3d2d5ee commit 215d385

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,38 @@ div1.removeChild(child[0]);
11201120
* DOM节点的操作
11211121
* DOM结构操作
11221122

1123+
## 04-06
1124+
### BOM操作
1125+
* Browser Object Model
1126+
#### 如何监测浏览器的类型
1127+
#### 拆解url的各部分
1128+
#### 知识点
1129+
* `navigator & screen`
1130+
1131+
```JavaScript
1132+
//navigator
1133+
var ua = navigator.userAgent;
1134+
var isChrome = ua.indexOf('Chrome');
1135+
console.log(isChrome);
1136+
//screen
1137+
console.log(screen.width);
1138+
console.log(screen.height);
1139+
```
1140+
1141+
* `location & history`
1142+
```JavaScript
1143+
//location
1144+
console.log(location.href);
1145+
console.log(location.protocel);
1146+
console.log(location.pathname);
1147+
console.log(location.search);
1148+
console.log(location.hash);
1149+
//history
1150+
history.back();
1151+
history.forward();
1152+
```
1153+
1154+
11231155
---
11241156

11251157
### JSDemo JS小程序

0 commit comments

Comments
 (0)