如何在网站中禁用打印屏幕按钮? [英] How to disable print screen button in website?

查看:67
本文介绍了如何在网站中禁用打印屏幕按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想禁用网站上的打印屏幕按钮。

我可以禁用右键单击和其他选项,如剪切,复制,粘贴,保存,使用以下代码打开,打印等:





$(文件).ready(function(){



$(body)。on(contextmenu,function(e){

return false;

} );



$(body)。bind(keyup keydown,function(e){

e.preventDefault() ;

返回false;

});



});





但是,我没有成功禁用打印屏幕按钮。



我是什么尝试过:





$(文件).ready(function(){



$(身体) .bind(keydown,function(e){

if(e.keyCode == 44){

return false;

}

});



});

解决方案

(文件) .ready(function(){



(body)。on(contextmenu,function(e){

返回false;

});



(body)。bind( keyup keydown,函数(e){

e.preventDefault();

返回false;

});



});





但是,我没有成功禁用打印屏幕按钮。



我尝试过:





Hi,
I want to disable print screen button in website.
I am able to disable right click and other options, like cut, copy, paste, save, open, print, etc using the following code:


$(document).ready(function () {

$("body").on("contextmenu",function(e){
return false;
});

$("body").bind("keyup keydown", function(e) {
e.preventDefault();
return false;
});

});


But, I am not getting success in disabling print screen button.

What I have tried:


$(document).ready(function () {

$("body").bind("keydown", function(e) {
if (e.keyCode == 44) {
return false;
}
});

});

解决方案

(document).ready(function () {


("body").on("contextmenu",function(e){
return false;
});


("body").bind("keyup keydown", function(e) {
e.preventDefault();
return false;
});

});


But, I am not getting success in disabling print screen button.

What I have tried:



这篇关于如何在网站中禁用打印屏幕按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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