Páginas

martes, 24 de junio de 2014

JavaScript Window (BOM) The browser Object Model. 004. History Back / Forward

Navegar por el historial con JavaScript.
Con este objeto podemos navegar por el historial hacia alante / atrás



El objeto window.history puede ser escrito sin prefijo.

Se compone de
history.back() (atrás)
history.forward() (adelante)

Ejemplo:
<html>
<head>
<script>
function goBack()
 {
 window.history.back()
 }
</script>
</head>
<body>
<input type="button" value="Back" onclick="goBack()">
</body>
</html>

No hay comentarios:

Publicar un comentario