- Writing to the JavaScript Console
- Reloading the Web Page
- Redirecting the Web Page
- Getting the Screen Size
- Getting Current Location Details
- Accessing the Browser
- Using the Browser History to Go Forward and Backward Pages
- Creating Popup Windows
- Manipulating Cookies
- Adding Timers
Using the Browser History to Go Forward and Backward Pages
The browser keeps track of the pages that have been navigated to in a history. JavaScript allows you to access this history to go forward or backward pages. This allows you to provide forward and backward controls to your web pages. You can also use this feature to provide bread crumbs displaying links to multiple pages back in the history.
To go forward one page, use history.forward(). To go backward one page, use history.back().
To go forward or backward multiple pages, use history.go(n), where n is the number of pages. A negative number goes backward that many pages, and a positive number goes forward that many pages.