View Full Version : how to disable back button of the browser?

12-24-2003, 07:17 AM

Can anybody please tell me how to diable the back button or the back button should not work if somebody presses it from the second page or is there any option to create the files from history.

thank you.

12-24-2003, 07:32 AM
How about: http://www.codingforums.com/showthread.php?s=&threadid=27552

12-25-2003, 09:22 PM
A browser's history is stored in an array. I don't know how to read it by array index but history.go(-1) works as a back button. alert(history) is an object and alert(history[0]) is undefined. But I'm pretty sure that this would be a Read-Only array to ensure the security of the user's browser. Personally I don't see any convenient use of this. And I'm sick of porn sites and fake search engines coming in google that use 1 or more page redirections to try to trap you on their page :mad:.

12-29-2003, 12:53 AM
I agree - there is no good or valid reason to disable the backspace key.

12-30-2003, 02:11 AM
I only know that some of the sites that I went to, they purposely refresh the same page if you press backspace or the back button. That's to 'stuck' the surfers to their site. Don't know if it'll affect their hit counters.

Other sites when registering, they validate if the user has already been used. They'll alert if it has and tell the user to register under a new name.

Another way I saw was that the cookie session expires once the form is submitted.

There are times when I'm just searching for stuff on the web & I won't like to have my Back button disabled when the site is not the relevent site. I like to go back to my search results and try other sites.

12-30-2003, 03:36 AM
Originally posted by Tails
But I'm pretty sure that this would be a Read-Only array to ensure the security of the user's browser.

I'm pretty sure that is how it works. It would be a major security flaw otherwise.