1

Edit: Is it a good thing to use?

window.onbeforeunload = function(e) {

};

In this function I should detect if user click refresh and if YES then do this: $_POST['enter'] = NULL;

Catalina
  • 95
  • 2
  • 12

1 Answers1

0

If you are looking for capturing the key event. This code can help you.

$(document.body).on("keydown", this,
     function (event) { 
          if (event.keyCode == 116) { alert('F5 pressed!'); 
       } 
});
Muhammad Shahzad
  • 9,340
  • 21
  • 86
  • 130
Deep
  • 9,594
  • 2
  • 21
  • 33