I use a timer on my php page, but when some page refresh starts from the beginning of the timer. I want to disable the f5 or reload option on my php page.
Thanks in advance
I am testing it and it works.
function disable_f5(e) { if ((e.which || e.keyCode) == 116) { e.preventDefault(); } } $(document).ready(function(){ $(document).bind("keydown", disable_f5); });
Unable to disable these browser features. Would you like a page to disable your F5 key? I doubt it. If you are trying to implement some kind of protection here, I suggest checking the correct approaches to server-side validation.
- , !
, , - , , , / .
See here: Warning when browser window is accidentally closed