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
  • 8,624
  • 20
  • 79
  • 128
Deep
  • 9,344
  • 2
  • 17
  • 31