Javascript Go Back to Previous Page Button Link

Go Back javascript history button links to allow visitors to go back to previous page. Here the free javascript code.

Want to add a back button navigation to your web page links. Here is how to do this using javascript and html links.

The code we’ll use look a bit like this: “javascript:history.go(-1)” .

With that code we are telling the browser to go back -1 page. You can change the -1 number to any page history like -2 or -5. So if you choose go back -3, you will send the visitor three pages back in their browser history.

Here’s the source code:

Go Back One Page 

Click here to try the code: Go back one page

Tagged : / / / / / / /

4 thoughts on “Javascript Go Back to Previous Page Button Link

  1. I am trying to use a PHP script that cycles through images while someone is on a particular page. But when it refreshes its producing more history(only the image refreshes, but it does make more history). So if i let it sit for a few hours i'd have hundreds of page reloads and you'd never be able to click "back" fast enough or enough times to get out of the site and back to the page before you entered. Is there a way to to count the number of times a page refreshes and use your script so it just goes back "-257" times if needed?

Leave a Reply

Your email address will not be published. Required fields are marked *