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;
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;
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!');
}
});