Tutorials » Javascript » Back Buttons




Intro

So you want a back button. It's my pleasure to tell you that this is probably the easiest tutorial you will ever need go through.

Body

Instead of going through the pain of linking a back button the previous page you think the visitor was visiting, which will take a painfully long time, there's a much, much easier way to do it. Are you familiar with Javascript? No? That's okay, because you don't need to know anything about it, except that you're going to use it.

Paste this code into your BODY tag, wherever you want the back code to be displayed.



The only option you have to make is what you want the text to say. You can even make it an image. It's really a link, but like a pop-up link, there's Javascript instead of a URL.

If you would like to use the back or forwards arrows, here are a few to choose from (with HTML to the right):

»»
««
→
←

Conclusion

Other than that, there's really nothing you need to do with the code. You can place it anywhere on a page and it will send the visitor back to the page they had viewed before it, just like the back button on a browser. It helps visitors not to get lost on your site, which is better for you because they'll be more likely to stay longer if they know how to navigate your site! Good luck!




 
 

All content copyright their respective owners. No copyright infringement is intended, and no money is being made.