Internet Resource

Add a Back Link for Your Previous Page

There are 2 methods for going back to previous page using Anchor Tag <a>, below are 2 working methods and out of them 1st one is faster and have one great advantage in going back to previous page.


<a href="#" onclick="location.href = document.referrer; return false;">Go Back</a>


<a href="javascript:history.back()">Go Back</a>

Above method (2) only works ok if you have clicked on a link and opened link in a Current Tab in current browser window.

It will not work if you have open link in New Tab. Here history.back() will not work if link is opened in New Tab of web browser.