The length property returns the number of URLs in the history list of the current browser window.
The property returns at least 1, because the list includes the current page.
This property is useful to find out how many pages the user has visited in the current browsing session.
history.back()
will only work if a previous page exists in the history list.
history.length
NONE |
Type | Description |
A number | The number of entries in the history list. |
history.length()
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!