如何在网站中禁用打印屏幕按钮? [英] How to disable print screen button in website?
问题描述
我想禁用网站上的打印屏幕按钮。
我可以禁用右键单击和其他选项,如剪切,复制,粘贴,保存,使用以下代码打开,打印等:
$(文件).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屋!