Click to See Complete Forum and Search --> : Controling the 'Back' button of the browser


reuvenh
05-11-2003, 07:40 AM
Hi,
I want to find a javascript that can control the 'Back' button of the browser. I want to go 2 pages back instead of one, when the user the clicks the 'Back' button of the browser.
How can I do it?

Thanks a lot,
Mytal.

GavinPearce
05-11-2003, 07:45 AM
Soz mate but don't think it can be done. There is no script that when you click the back button on the browser it can define what page you goto.

You may possibly be able to do it with comlicated javascripting using the page 1 back. When the refer to that page is javascript:window.history(-1) or sumething the script will send you back one more page. It's would be complicated to set up and have havce neither the skills nor the expertise to do it.

So bascially no you can't control the back button on the browser. :D

GavinPearce
05-11-2003, 12:24 PM
Yea gud thinking.

You can also have a link back to the page you want using javascript so it goes back 2 pages (i think)

I'm only 14 so I'm not to sure but I know the javascript code for going back is something like javascript:history.go(-1); or something like that.

I'm guessing if you put -2 instead of -1 it will go back two pages instead of one when you hit the link.