Get to know History object in Javascript

Object of History

The history object represents the user's navigation history. The history object is a property of window. Each browser window, tab, and frame has its own history object.

It's not possible to determine the visited URLs. It is possible to navigate backwards and forwards.

The following table lists the properties and methods in history object.

NameDescriptionReturns
back()Goes one step back.void
forward()Goes one step forward.void
go(index)Goes to a position relative to the current document. Positive values are forward, negative are backward.void
lengthReturns the number of items in the history.number
pushState(state, title, url)Adds an entry to the browser history.void
replaceState(state, title, url)Replaces the current entry in the browser history.void
stateReturns the state data associated with the current document in the browser history.object




















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window