# Question about browser navigation

**URL:** <https://forum.kirupa.com/t/question-about-browser-navigation/18650>\
**Category:** programming\
**Created:** [April 19, 2003, 12:06am UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650 "2003-04-19T00:06:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![upuaut](https://avatars.discourse-cdn.com/v4/letter/u/9fc348/32.png) [@upuaut](https://forum.kirupa.com/u/upuaut)\
**Post date:** [April 19, 2003, 12:06am UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/1 "2003-04-19T00:06:37Z")

</div>

I’m wondering if anyone knows a way to SET the previous page in a browser so that when a user clicks on the back button they go to that page.

Anyone have an idea?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 12:16am UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/2 "2003-04-19T00:16:46Z")

</div>

```php
<script>

/*
Back home button- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

function gohome(){
if (document.layers)
window.home()
else if (document.all)
window.location="about:home"
else
alert("You need NS 4+ or IE 4+ to go back home!")
}
</script>

<form>
<input type="button" onClick="gohome()" value="Take Me Home!">
</form>

<!--if you wish to use an image instead of a form button, uncomment this portion
<a href="javascript:gohome()"><img src="http://dynamicdrive.com/dynamic.gif"></a>
-->

```

i know that there is an easyer way, let me search some more, this has alot of code, i know that there is one with only aboue 6 lines. i will be back in a couple of min;)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 12:18am UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/3 "2003-04-19T00:18:37Z")

</div>

never mind about the first code,

```php
<a href="javascript:history.go(-1)">go back</a>

```

> **[Java Tip 15: How to make a "Back" button in JavaScript](https://www.javaworld.com/article/2077511/learn-java/java-tip-15--how-to-make-a--back--button-in-javascript.html)**
>
> Provide the ability for your users to jump from your page back to
> whatever document they were previously viewing. (300
> words)

hope this helps:)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 12:23am UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/4 "2003-04-19T00:23:24Z")

</div>

I hope so too. I’ll let you know. Thanks for the info.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 4:39pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/5 "2003-04-19T16:39:47Z")

</div>

your welcome

did it work? 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 4:44pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/6 "2003-04-19T16:44:36Z")

</div>

You could just use…

\<A HREF=“javascript:history.forward()”\>Go Forward\</A\>

and

\<A HREF=“javascript:history.back()”\>Go Back\</A\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 5:02pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/7 "2003-04-19T17:02:59Z")

</div>

I think he is asking if you can SET the back button. Like he doesn’t want them to just go back a page he wants to dictate which page they go to when they click the back button…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 5:05pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/8 "2003-04-19T17:05:18Z")

</div>

Then why not hard code it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 9:32pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/9 "2003-04-19T21:32:08Z")

</div>

how can you hard code browser buttons?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 9:45pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/10 "2003-04-19T21:45:10Z")

</div>

AHHH, I am so confused.

Is this browser buttons? Or HTML created links?

Is this a back button? Or a button that links back to a certain page?

If it is browser buttons, you can’t change the function of those.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 9:53pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/11 "2003-04-19T21:53:37Z")

</div>

what is hard code. ☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 9:55pm UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/12 "2003-04-19T21:55:24Z")

</div>

no variables…

Rev ![](http://www.aulman.com/rev.gif)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 21, 2003, 3:57am UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/13 "2003-04-21T03:57:42Z")

</div>

ok… well the solution came through other means. but I’ll let you know what it was I was asking… that’s the least I can do. 🙂

The deal was. I had a redirection page. Normally when you redirect your audience, and they use their back button, they go to the last page and then get redirected right back where they were instead of getting out of your pages. I was attempting to find a method of by passing the redirect page in the cache of “back pages” that were stored in the browser so that a use of the back button on the entrance page would send the user to their previous location on the web.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 21, 2003, 4:36am UTC](https://forum.kirupa.com/t/question-about-browser-navigation/18650/14 "2003-04-21T04:36:19Z")

</div>

Ohhhhhhh, I gotcha.
