capture back button on the IE toolbar..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bravo
    New Member
    • Jul 2007
    • 43

    capture back button on the IE toolbar..

    hi
    using javascript i am able to capture the backspace key and also to disable it but it is not working for the back button on the toolbar. i am new to javascript
    have searched a lot but didnt got success.... the code i have written is like this

    Code:
    <script language="JavaScript">
    <!--
    window.document.onkeydown = Backkeyhandler;
     
    function Backkeyhandler() {
        if (window.event && window.event.keyCode == 8) {
            
             // alert("BackSpace Pressed !!");
              return false;
        }
    }
    //-->
    </script>



    could any body please provide me the links or suggestion on how to capture the back button and if it works for IE only then also it is fine for me...
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Why would you want to disable the back button? There may be an alternative.

    If it's for a web application where the user would lose unsaved work, use onbeforeunload.

    Comment

    Working...