We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c2983e commit 64ae2a9Copy full SHA for 64ae2a9
docs/bom/history.md
@@ -29,6 +29,15 @@ History 对象主要有两个属性。
29
- `History.length`:当前窗口访问过的网址数量(包括当前网页)
30
- `History.state`:History 堆栈最上层的状态值(详见下文)
31
32
+```javascript
33
+// 当前窗口访问过多少个网页
34
+window.history.length // 1
35
+
36
+// Histroy 对象的当前状态
37
+// 通常是 undefined,即未设置
38
+window.history.state // undefined
39
+```
40
41
## 方法
42
43
### History.back()、History.forward()、History.go()
@@ -48,7 +57,7 @@ history.go(-2);
48
57
`history.go(0)`相当于刷新当前页面。
49
58
50
59
```javascript
51
-history.go(0);记录
60
+history.go(0); // 刷新当前页面
52
61
```
53
62
54
63
注意,移动到以前访问过的页面时,页面通常是从浏览器缓存之中加载,而不是重新要求服务器发送新的网页。
0 commit comments