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!

history.back

Status
Not open for further replies.

altaratz

ISP
Apr 15, 2001
73
US
I have an embedded back button with the following

<a href=&quot;javascript:history.back()&quot;>

but when I go outsode of the domain, the back doesn't work (i.e. it just brings up a 404 no find page) - is there a better 'back' functionality with javascript that I can put in, to more approximate a browser's 'back?'

Thanks for any answers!

Ethan
 
that is the wrong code...you want
Code:
<a href=&quot;javascript:history.go(-1)&quot;>back</a>
you put whatever you want in the ()'s (- is back, + is forward) the number is the number of pages to go.

-Greg
 
There's really nothing wrong with using history.back() - it IS valid code, EXCEPT that it doesn't seem to work correctly some of the time. history.go(-1) seems to be much more reliably.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top