History.length
read-only property returns an integer representing the number of elements in the session history, including the currently loaded page.
For example, for a page loaded in a new tab this property returns
1
.
const length = history.length
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'History.length' in that specification. |
实时标准 | 无变化自 HTML5 . |
|
HTML5
The definition of 'History.length' in that specification. |
推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
length
|
Chrome Yes | Edge 12 | Firefox Yes | IE 10 | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
历史
interface it belongs to.
历史
length
scrollRestoration
state