CancelImage Upload

How to go back to the last page visited with the help of JavaScript

Returning to the last place a user has visited is easy with JavaScript. All that is required is the windows history object, and the function back():

<a href="javascript:window.history.back();">Click here to return to last page.</a>

As you can see from the example above, the function back() is called upon via an anchor tag, which in turn propels the user to the last page they have visited. To actually access the last page as a value, see the tutorial on the variable referrer.

Want to leave a comment?

No problem. Just enter your email and password below.

register | home | reminder

myDesignTool Networking •