Article From:https://segmentfault.com/q/1010000011713532
Question:

Why is it that only Search Dog and 360’s backspace go back to the previous step, while Chrome doesn’t go back to the previous step but doesn’t react?

Answer 0:

Monitor the mouse button. The key code of backspace is 8, which prevents the default event.

document.onkeydown=function(e){
    var isie = (document.all) ? true:false;
    if(isie){
        key = window.event.keyCode;
    }else{
        key = e.which;
    }
    if(key===8){
        console.log(‘backspace’);
        e.preventDefault();
    }
};

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *