Click here to Skip to main content
15,924,402 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear sir,
I need disable all refresh events

Example.
1. F5,
2. Mouse right click option (refresh/reload),
3. CTRL+R,
4. Menu bar -> view -> refresh and
5. URL refresh/reload button

How to disable these all events by using PHP or JS
Posted
Comments
Sergey Alexandrovich Kryukov 27-Dec-15 14:48pm    
Why?
—SA

1 solution

As long as it is about keys, like F5 and Ctrl+R, you can override the keydown events (for instance using jQuery) and 'swallow' it...However you can not block menu events, as you do not receive any indication about them, they are external for your page...
You may assign some state to your page and return the same content for the same state, but that can be done only at the server side...
(To get more specific ideas you should describe in more details the problem you try to solve...)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Dec-15 14:49pm    
5ed. Perhaps you tried to hard to help. I would start with the question, why doing all that... :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900