API Sejarah
Objek Sejarah Jendela
Objek histori berisi URL yang dikunjungi oleh pengguna (di jendela browser).
Objek sejarah adalah properti dari objek jendela .
Objek sejarah diakses dengan:
window.history
atau hanya history
:
Contoh
let length = window.history.length;
let length = history.length;
Properti Objek Sejarah
Property | Description |
---|---|
length | Returns the number of URLs (pages) in the history list |
Metode Objek Sejarah
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 |