Packagedom.objects
Classpublic class History
InheritanceHistory Inheritance Object

Introduced in: DOM 0 

Contains information about the URLs visited by the client.

Note: For security reasons, the history object does not expose the actual URLs in the browser history. It does allow navigation through the browser history by exposing the back, forward, and go methods. A particular document in the browser history can be identified as an index relative to the current page. For example, specifying -1 as a parameter for the go method is the equivalent of clicking the Back button.

See also

MSDN - history Object
MDC - window.history


Public Properties
 PropertyDefined By
  Non-Standard current : DOMString
Returns the URL of the active item of the session history.
History
  DOM 0 length : Number
[read-only] Returns the number of elements in the session history, including the currently loaded page.
History
  Non-Standard next : DOMString
Returns the URL of the next item in the session history
History
  Non-Standard previous : DOMString
Returns the URL of the previous item in the session history
History
Public Methods
 MethodDefined By
  
DOM 0 back():void
Goes to the previous page in session history, the same action as when the user clicks the browser's Back button.
History
  
DOM 0 forward():void
Goes to the next page in session history, the same action as when the user clicks the browser's Forward button.
History
  
DOM 0 go(integerDelta:*):void
Loads a page from the session history, identified by its relative location to the current page, for example -1 for the previous page or 1 for the next page.
History
Property Detail
currentproperty
current:DOMString

Non-standard (Mozilla)

Returns the URL of the active item of the session history.


Implementation
    public function get current():DOMString
    public function set current(value:DOMString):void

See also

DOM 0 lengthproperty 
length:Number  [read-only]

Introduced in: DOM 0 

Returns the number of elements in the session history, including the currently loaded page.


Implementation
    public function get length():Number

See also

nextproperty 
next:DOMString

Non-standard (Mozilla)

Returns the URL of the next item in the session history


Implementation
    public function get next():DOMString
    public function set next(value:DOMString):void

See also

previousproperty 
previous:DOMString

Non-standard (Mozilla)

Returns the URL of the previous item in the session history


Implementation
    public function get previous():DOMString
    public function set previous(value:DOMString):void

See also

Method Detail
DOM 0 back()method
public function back():void

Introduced in: DOM 0 

Goes to the previous page in session history, the same action as when the user clicks the browser's Back button.

Equivalent to history.go(-1).

Calling this method to go back beyond the first page in the session history has no effect and doesn't raise an exception.

See also

DOM 0 forward()method 
public function forward():void

Introduced in: DOM 0 

Goes to the next page in session history, the same action as when the user clicks the browser's Forward button.

Equivalent to history.go(1).

Calling this method to go back beyond the last page in the session history has no effect and doesn't raise an exception.

See also

DOM 0 go()method 
public function go(integerDelta:*):void

Introduced in: DOM 0 

Loads a page from the session history, identified by its relative location to the current page, for example -1 for the previous page or 1 for the next page.

When integerDelta is out of bounds (e.g. -1 when there are no previously visited pages in the session history), the method doesn't do anything and doesn't raise an exception.

Calling go() without parameters or with a non-integer argument has no effect (unlike Internet Explorer, which supports string URLs as the argument [1]).

Parameters

integerDelta:* — Specifies an integer or a string. An integer indicates the relative position of a URL in the History list. A string indicates an exact URL in the History list.

See also