禁用“刷新和退格”按钮 [英] Disable Refresh and Backspace button
本文介绍了禁用“刷新和退格”按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们需要在启用母版页的页面中使用java脚本从键盘禁用Refresh,F5和Back Space事件。
请提供防止这些功能的代码。
问候
Sreejith
Hi,
We need to disable the Refresh,F5 and Back Space event from keyboard using java script in a master page enabled pages.
Please provide the code to prevent these functionalities.
Regards
Sreejith
推荐答案
试试这个:
try this:
( window )。bind(' beforeunload', function (e){
if ( / * 某些条件允许刷新* / )
{
e.preventDefault();
}
});
(window).bind('beforeunload', function(e) { if (/*Some condition that will allow refresh*/) { e.preventDefault(); } });
这篇关于禁用“刷新和退格”按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文