История окна
Объект истории окна
Объект истории содержит URL-адреса, посещенные пользователем (в окне браузера).
Объект истории является свойством объекта окна .
Доступ к объекту истории осуществляется с помощью:
window.history
или просто history
:
Примеры
let length = window.history.length;
let length = history.length;
Свойства объекта истории
Property | Description |
---|---|
length | Returns the number of URLs (pages) in the history list |
Методы объекта истории
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 |