Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to diable browser back button

 
Shivanath Yerra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to disable the browser back button?
 
Jeff Sunder
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4363
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic