go back to previous page

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Elaine Shuman
Advanced
Advanced
Posts: 10
Joined: Wed Sep 10, 2003 7:49 pm

go back to previous page

Post by Elaine Shuman »

When users are within the menu and want to go back to a previous page, they end up back at the home page, even if they were on another page within the site. Is there a way for users to go back to the previous page. Our users are frustrated by always having to start over at the home page. I saw a post in the version 3 section that said to use this code:

[code]<a href="javascript:history.back();">[/code]

But I don't know where to put it or if this will work.
thanks
Elaine
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Try this:

Code: Select all

aI("text=Back;url=javascript:history.go(-1);");
aI("text=Next;url=javascript:history.go(+1); ");
Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Re: go back to previous page

Post by kevin3442 »

Hi Elaine,
Elaine Shuman wrote:When users are within the menu and want to go back to a previous page, they end up back at the home page, even if they were on another page within the site. Is there a way for users to go back to the previous page....
I'm a little confused. Are you saying that the browser's "Back" button isn't working??? (That would be disturbing!) Or are you trying to implement your own "Back" button using the menus, and that isn't working?

Ruth's suggestion should work for a menu implementation of "Back". history.go(-1) is the equivalent to history.back(), and history.go(1) is the equivalent to history.forward(). So, you could also use

Code: Select all

aI("text=Back;url=javascript:history.back();");
aI("text=Next;url=javascript:history.forward();");
Cheers,

Kevin
Post Reply