Click to See Complete Forum and Search --> : browser histoy


harddrive
07-03-2003, 08:46 AM
I have back buttons in my page menus using
<a href="javascript:history.back(-1)">back</a>

I am also using a named anchor at the botom of the page.
<a href="#top">back to top></a>

Both work ok --- but if you return to the top of the page using the back to top button the "back" button needs to be clicked twice as the history is holding the page url twice the second time registering from the use of the "back to top" button.

How can I get the back to top button not to add the page url to the history list?

Thanks for any help.

pyro
07-03-2003, 08:52 AM
I think the only option you are going to have would be something like this:

<a href="#top" onclick="window.location.replace(this.href); return false;">back to top</a>

Basically, that will replace the current page in the history, with your new one (the anchor to the top of your page).

pelegk1
07-03-2003, 08:55 AM
will delete his history and by that won;t go back!
what u can do is to do a click counter
or onClick()
u can check whats in the history
and by that to do :
goback(-1) or goback(-2)

pyro
07-03-2003, 08:58 AM
Originally posted by pelegk1
will delete his history and by that won;t go back!That is incorrect. What it will do isOriginally posted by pyro
replace the current page in the history, with your new oneSo, if you browse to the page from Yahoo!, then click the link that I posted above, and then hit the back button, you will go to Yahoo!

harddrive
07-03-2003, 09:06 AM
Hi Guys thanks it works just fine.

What a great service it is the first posting to this forum

Thanks again and a reply in minutes.

pyro
07-03-2003, 09:08 AM
You're welcome... :)