History.Back Object
The History object contains an array of previously visited URLs by the visitor. To simulate the browser's back button, for example, you can use the History object:
<html> <head> <title>Javascript - Browser history list manipulation</title> </head> <body> <a href="javascript:history.back(-1)">Go Back one Page</a> <a href="javascript:history.back(-2)">Go Back Two Page</a> <a href="javascript:history.back(-3)">Go Back Three Page</a> . . . <a href="javascript:history.back(-n)">Go Back n Page</a> </body> </html> |
History.Forward Object
The History object contains an array of Next visited URLs by the visitor. To simulate the browser's forward button, for example, you can use the History object:
<html> <head> <title>Javascript - Browser history list manipulation</title> </head> <body> <a href="javascript:history.forward(1)">Go Forward one Page</a> <a href="javascript:history.forward(2)">Go Forward Two Page</a> <a href="javascript:history.forward(3)">Go Forward Three Page</a> . . . <a href="javascript:history.forward(n)">Go Forward n Page</a> </body> </html> |
History.go
Go to nearest URL in History List.
<html> <head> <title>Javascript - Browser history list manipulation</title> </head> <body> <a href="javascript:history.go(Link Address)">Link name</a> </body> </html> |
No comments:
Post a Comment