my dog learned polymorphism
The moose likes HTML, CSS and JavaScript and the fly likes how to diable browser back button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to diable browser back button" Watch "how to diable browser back button" New topic

how to diable browser back button

Shivanath Yerra

Joined: Jul 16, 2001
Posts: 8
how to disable the browser back button?
Jeff Sunder
Ranch Hand

Joined: Jun 26, 2001
Posts: 47
I have done a lot of research on this and the basic answer is that you cannot. There are many tricks that you can try, but none of them actually disable the back button.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

Jeff is correct however one of the tricks he mentions is this:
The location object's replace() method overwrites the current history entry with the specified URL. It removes the current history entry before the next URL is loaded. Removing the item from the history list also prevents users from seeing the page again by clicking on the Back button later.
This technique is very useful for online games and multi-page forms, where you want prevent the user from returning to the previous page. Furthermore, the location.replace() method is supported by all browsers except Navigator 2.0x. The following example shows how to use this method in a link:

<A HREF="javascript:location.replace('nextpage.html')">Advance</A>

Visit my download page
I agree. Here's the link:
subject: how to diable browser back button
It's not a secret anymore!