Navigating within the Browser s History


Navigating within the Browser's History

window.history.back(); window.history.forward(); 

The browser history is represented by the history object (a property of the window object) and contains a list of web pages visited prior to (and, if available, after) the current page. And although it is technically possible to move a couple of elements within the history, security constraints leave only one viable way: going one page back and one page forward. The following two methods implement that:

  • back() moves to the previous page in the history (like the back button does).

  • forward() moves to the next page in the history (like the forward button does).




JavaScript Phrasebook(c) Essential Code and Commands
JavaScript Phrasebook
ISBN: 0672328801
EAN: 2147483647
Year: 2006
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net