The history Object

The Web browser also maintains a list of pages that you have visited since running the program; this list is called the history list, and it can be accessed through the history object. Your JavaScript programs can move through pages in the list by using the properties and functions shown in Table 19.2.

The history.length, therefore, returns the number of entries in the history list. The methods history.back() and history.forward() causes the Web browser to load the previous and next entry in the history list, if any.

Table 19.2. The history Object Contains Information on the Browser's History List
Property Type What It Does
current property Contains the URL of the current history entry
length property Contains the number of ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.