Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No History - On One Link Only

Status
Not open for further replies.

DonP

IS-IT--Management
Jul 20, 2000
684
US
I have a "Top" button at the bottom of my page, which is simply a little hyperlinked image to take people back to teh top without the need to scroll. Is there a way to make it NOT save history when clicked but to otyherwise still work? Otherwise, the "Previous Page" JavaScript history button at the top just goes back to the bottom. Thanks!

Don
don@ctagroup.org
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
you had :
<a href=&quot;#topofthepage&quot;>link</a>

replace it with :
<a href=&quot;javascript:this.document.location.history.replace('#topofthepage')&quot;>link</a>

as history.replace(url) actually replaces the previous entry in the history list (instead of adding a new entry)
 
Thanks! But when I replace my existing line with <a href=&quot;javascript:this.document.location.history.replace('#TOP')&quot;>link</a>, I get a JavaScript error when selecting the link: &quot;this.document.location.history&quot; is null or not an object.&quot; Is there a typo here?

Don
don@ctagroup.org
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
sorry i don't have no time to go to devedge or msdn, so i suugest you go and quickly check for the correct syntax - it might be document.location.replace('url') tho .... the keyword is replace ... also, as it replaces the current entry, you have to set it to the PREVIOUS link :
<a href=&quot;location.replace('page1')&quot;>link1</a>
<a href=&quot;location='page2'&quot;>link2</a>
<a href=&quot;location.replace('page3')&quot;>link3</a>
if you click all the liks, the history list will be :
page1 (previous entry was replaced) and page3 (as page2 was added with link2 but replaced by page3 with link3)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top