PDA

View Full Version : javascript history back help....



agnieszka
December 15th, 2002, 19:54
how do i alter this script:

<form><input type="button" value="back" onClick="history.back()"></form>

to go back 2 history thingies, rather than one?

thanks.
ag.

zoobie
December 16th, 2002, 00:36
history.go(-2); :D

agnieszka
December 16th, 2002, 07:58
thaks :-) i ended up using location.href="" instead, to ensure my viewers were sent to the exact addy anyway. the history.go(-2) (which i logically figured out myself after a little playing around) didn't seem to work well in on all occassions on all browsers at all times, but the location.href did, so i stuck with that. thanks anyway :-)

zoobie
December 16th, 2002, 14:25
Yep...That'll work, too. ;)