The history object contains the URLs visited by the user (in the browser window).
The history object is a property of the window object.
The history object is accessed with:
window.history
or just history
:
let length = window.history.length;
Try it Yourself »
let length = history.length;
Try it Yourself »
Property/Method | Description |
---|---|
back() | Loads the previous URL (page) in the history list |
forward() | Loads the next URL (page) in the history list |
go() | Loads a specific URL (page) from the history list |
length | Returns the number of URLs (pages) in the history list |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!