API de historial
El objeto de historial de ventana
El objeto de historial contiene las URL visitadas por el usuario (en la ventana del navegador).
El objeto de historial es una propiedad del objeto de ventana .
Se accede al objeto de historial con:
window.history
o simplemente history
:
Ejemplos
let length = window.history.length;
let length = history.length;
Propiedades del objeto de historial
Property | Description |
---|---|
length | Returns the number of URLs (pages) in the history list |
Métodos de objetos de historial
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 |