| Package | dom.objects |
| Class | public class History |
| Inheritance | History Object |
| Introduced in: | DOM 0 |
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
| Property | Defined 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 | ||
| Method | Defined 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 | ||
| current | property |
current:DOMStringNon-standard (Mozilla)
Returns the URL of the active item of the session history.
public function get current():DOMString public function set current(value:DOMString):voidSee also
| DOM 0 length | property |
length:Number [read-only] | Introduced in: | DOM 0 |
Returns the number of elements in the session history, including the currently loaded page.
public function get length():NumberSee also
| next | property |
next:DOMStringNon-standard (Mozilla)
Returns the URL of the next item in the session history
public function get next():DOMString public function set next(value:DOMString):voidSee also
| previous | property |
previous:DOMStringNon-standard (Mozilla)
Returns the URL of the previous item in the session history
public function get previous():DOMString public function set previous(value:DOMString):voidSee also
| 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