What i want to do is, if i press back button when any other pop up is opened , i should close that pop up and reload the page .
i have tried below. but it is only taking the keyboard backbutton but not browser back button. can any one help me to solve this
$(document).ready(function() {
     $(document).bind("keydown keypress", function(e){
            if( e.which == 8 ){ // 8 == backspace
                alert("back button");
            }
        });
}
 
     
     
     
    