Possible Duplicate:
Page history - back button exists?
I need to have a link in some pages of a website, by clicking on it, it needs to go back to the previous page, just like the browser's back button. What is the right way to do that? I'm thinking that I should use some client side scripting like Javascript, right?
In JavaScript, it's:
history.go(-1);
or
history.back();
Just use
history.go(-1);
But you cannot go forward anymore after that (so the Forward button doesn't bring you back to where you were -- i.e., this is not 100% the same as clicking the Back button).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With