如何禁用所有刷新事件? [英] How to disable all refresh events ?

查看:78
本文介绍了如何禁用所有刷新事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

我需要禁用所有刷新事件



示例。

1. F5,

2.鼠标右键单击选项(刷新/重新加载),

3. CTRL + R,

4.菜单栏 - >查看 - >刷新和

5. URL刷新/重新加载按钮



如何使用PHP或JS禁用这些所有事件

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

推荐答案

只要它是关于键,如F5和Ctrl + R,你可以覆盖keydown事件(例如使用jQuery)和'吞下'它...但是你不能阻止菜单事件,因为您没有收到任何关于它们的指示,它们在您的页面外部...

您可以为您的页面指定一些状态并为相同的状态返回相同的内容,但是只能在服务器端进行...

(为了获得更具体的想法,你应该更详细地描述你试图解决的问题......)
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...)


这篇关于如何禁用所有刷新事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆