如何在浏览器上禁用F5刷新? [英] How do I disable the F5 refresh on the browser?
本文介绍了如何在浏览器上禁用F5刷新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
最好使用JavaScript,但也想听听其他方式
Preferably using JavaScript but would like to hear other ways too
推荐答案
这将禁用F5,但不会禁用实际的刷新功能:
This will disable F5, but not the actual refresh function:
document.onkeydown = function (e) {
if (e.keyCode === 116) {
return false;
}
};
至少在Chrome/XP上.
On Chrome/XP, at least.
这篇关于如何在浏览器上禁用F5刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文