Difference between revisions of "JavaScript History Object"
From Techotopia
Line 7: | Line 7: | ||
</table> | </table> | ||
<hr> | <hr> | ||
+ | |||
+ | |||
+ | <google>BUY_JAVASCRIPT</google> | ||
+ | |||
<google>ADSDAQBOX_FLOW</google> | <google>ADSDAQBOX_FLOW</google> |
Revision as of 18:58, 15 April 2009
Previous | Table of Contents | Next |
JavaScript Location Object | JavaScript Arrays |
<google>BUY_JAVASCRIPT</google>
<google>ADSDAQBOX_FLOW</google>
The JavaScript History object is a child of the Window object and holds information about the URLs visited before and after the current URL.
The object has the following methods and properties:
- history.length - a property containing the numner of URLs held in the history.
- history.go() - takes a postive or negative number as an argument to specify how many changes back or forward in the history to go. For example history.go(-4) is equivalent to pressing the Back buttonm in the browser 4 times.
- history.back() - equivalent to pressing the browser Back button (loads the previous page from the history list).
- history.forward() - equivalent to pressing the browser Forward button (loads the next page from the history if it exists).