ウィンドウ履歴
ウィンドウ履歴オブジェクト
履歴オブジェクトには、ユーザーが(ブラウザウィンドウで)アクセスした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 |