How to disable the back button in IE and firefox?

Duplicate:

  • Disable back button in browser
  • Preventing the use of the back button (in IE)

I need to disable the back and forward button of the browser (IE and Firefox). I tried:

//disable back button window.onbeforeunload= function() { } window.history.forward(1); 

but this only works in IE.
Is there a reliable solution?

+5
javascript html firefox
source share
4 answers

The answer is no. You cannot disable the back button.

Or at least in a good browser.

+14
source share

I believe this question has already been asked:

Disable the back button in the browser Disable the use of the back button (in IE)

If you are trying to prevent a user from losing their job, try something like:

 window.onbeforeunload = function() { return "You work will be lost."; }; 

Steve

+10
source share

There is no solution for this problem. You cannot "disable" it.

+3
source share

I would say that you should not completely disable the "Back" button, as users are accustomed to using it, and this will prevent them from finding their functionality.

The flow of users will be interrupted and they will leave your site.

+2
source share

All Articles