Disable Back Button in Browser

Technically it is not possible to disable the back button, however there are certain things you can do to work with the back button actions.

<SCRIPT>
window.history.forward();    function noBack() { window.history.forward(); }
window.onbeforeunload = function() { return "Please DO NOT USE the browser back button."; };
</SCRIPT>

This works great in IE and Chrome but not in other browsers.

You can also try:-

<SCRIPT type="text/javascript">
javascript:window.history.forward(1);
</SCRIPT>
</HEAD>
<BODY onload="noBack();"    onpageshow="if (event.persisted) noBack();" onunload="">

The above method works in IE, Mozilla Firefox, Chrome and Safari.

This works great IE, Firefox and Chrome however it doesnt work on Safari.

So the best method to use is the following:-

<SCRIPT type="text/javascript">
function changeHashOnLoad() {
     window.location.href += "#";
     setTimeout("changeHashAgain()", "50"); 
}

function changeHashAgain() {
  window.location.href += "1";
}

var storedHash = window.location.hash;
window.setInterval(function () {
    if (window.location.hash != storedHash) {
         window.location.hash = storedHash;
    }
}, 50);
</SCRIPT>
</HEAD>
<BODY onload="changeHashOnLoad(); ">

Let us know of any corrections or improvements.