Javascript (The browser objects): The History object

December 2016



The history object is a property of the document object. It contains the history of the browser, that is to say all the URLs visited by the user. These addresses can be accessed via the browser by clicking on the Next and Back buttons.

The history object has objects and methods to navigate through this address list directly from the current page.

The properties and methods of the object history


The properties and methods of the object history are few in numbers, but still can be very useful for navigating through webpage*.
  • The length property allows you determine the number of objects in history
  • The back method allows you to go back to the previous URL in the history
  • The forward method allows you to go back to the next URL in the history
  • The go method(variable) allows you to access a particular URL in the history.
    • The variable parameter is an integer (positive or negative) which determines the number of pages on which the desired URL is found.
  • Note that: On some browsers, when security level is enabled, this method won't give any results.


Original document publishe on CommentcaMarche.net

Related :

This document entitled « Javascript (The browser objects): The History object » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.