1、屏蔽f12

document.onkeydown = function(){
if(window.event && window.event.keyCode == 123) {
alert("F12被禁用");
event.keyCode=0;
event.returnValue=false;
}
if(window.event && window.event.keyCode == 13) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 8) {
alert(str+"\n请使用Del键进行字符的删除操作!");
window.event.returnValue=false;
}
}

2、屏蔽右键菜单

document.oncontextmenu = function (event){
if(window.event){
event = window.event;
}
try{
var the = event.srcElement;
if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){
return false;
}
return true;
}
catch (e){
return false;
}
}

3、屏蔽选中

document.onselectstart = function (event){
if(window.event){
event = window.event;
}
try{
var the = event.srcElement;
if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){
return false;
}
return true;
}
catch (e) {
return false;
}
}

4、屏蔽复制

document.oncopy = function (event){
if(window.event){
event = window.event;
}
try{
var the = event.srcElement;
if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){
return false;
}
return true;
}
catch (e){
return false;
}
}

5、屏蔽剪贴

document.oncut = function (event){
if(window.event){
event = window.event;
}
try{
var the = event.srcElement;
if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){
return false;
}
return true;
}
catch (e){
return false;
}
}

6、屏蔽粘贴

document.onpaste = function (event){
if(window.event){
event = window.event;
}
try{
var the = event.srcElement;
if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){
return false;
}
return true;
}
catch (e){
return false;
}
}

网页屏蔽f12、右键菜单等操作的更多相关文章

  1. js屏蔽浏览器右键菜单,粘贴,复制,剪切,选中(转)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. WinForm的TextBox限制只能输入数字并且屏蔽默认右键菜单

    基于Window消息实现 class TextBoxExt:TextBox { private const int WM_RBUTTONDOWN = 0x0204; private const int ...

  3. 利用js代码屏蔽f12,右键,粘贴,复制,剪切,选中,操作!!秀!秀!秀!

    koala 专注于个人技术分享 屏蔽f12审查 <script> document.onkeydown = function () { if (window.event && ...

  4. 学习 Message(5): 关于 TApplicationEvents.OnMessage 的第二个参数 可以屏蔽 TWebBrowser右键菜单:

    http://www.cnblogs.com/del/archive/2008/10/25/1319318.html TApplicationEvents.OnMessage 的第二个参数 Handl ...

  5. C# winform 屏蔽鼠标右键 spreadsheet Gear 屏蔽鼠标右键菜单

    今天用到spreadsheetGear 插件,然后右键有插件自己的菜单.都是英文的,而且还能打开新的窗体.嵌到程序里面,不太合适,所以着手屏蔽. 刚开始用的Mouse_up,虽然能捕获事件,但是没有K ...

  6. js屏蔽浏览器右键菜单

    <script type="text/javascript"> function doNothing(){ window.event.returnValue=false ...

  7. js 屏蔽浏览器右键菜单

    <script type="text/javascript"> function doNothing(){ window.event.returnValue=false ...

  8. 在Google Chrome中快速解除网页屏蔽鼠标右键、复制等限制

    第一步,将书签栏设置为显示状态!   第二步,添加新书签——>在标签栏点击右键,选择“添加网页”. 第三步,设置新书签的内容. 1.起名.这个凭个人爱好吧 2.网址栏输入: javascript ...

  9. 手机浏览器中屏蔽img的系统右键菜单context menu

    我们知道通过oncontextmenu事件可以屏蔽浏览器右键菜单 $('img').on("contextmenu",function(E){E.preventDefault(); ...

随机推荐

  1. eclipse中,将springboot项目打成jar包

    1.右击项目,选择Run As - Maven clean 2.右击项目,选择Run As - Maven install 3.成功后 会在项目的target文件夹下生成jar包 4.将打包好的jar ...

  2. GP card规范学习笔记

    9.   APDU命令参考 9.1  总的编码规则 A.生命周期状态的编码 可执行的装载文件 b8 b7 b6 b5 b4 b3 b2 b1 含义 16进制命令  0 0 0 0 0 0 0 1 LO ...

  3. Django 数据库迁移

    Django 数据库迁移 DATABASES = { # Django默认配置使用sqlite3数据库 # 'default': { # 'ENGINE': 'django.db.backends.s ...

  4. java 实现excel 导出功能

    实现功能:java导出excel表 1.jsp代码 <form id="zhanwForm" action="<%=path%>/conferences ...

  5. 第一章 HTML+CSS(中)

    4.域元素(form表单.textarea文本域.fieldset域集合.input使用) 案例 表单 用户名: 密码: 昵称: 你喜欢的水果有? 苹果 黄瓜 香蕉 请选择性别 男 女 请选择你要的网 ...

  6. Linux查看和修改文件时间

    参考http://www.361way.com/chang-file-time/1632.html 一:查看时间 1:查看文件的具体时间信息 File: `probn' Size: Blocks: I ...

  7. zabbix之 qq邮件报警

    一.安装sendmail或postfix[root@zabbix ~]# yum install sendmail –y                     #在线yum安装sendmail[ro ...

  8. mySQL 判断表是否存

    select `TABLE_NAME` from `INFORMATION_SCHEMA`.`TABLES` where `TABLE_SCHEMA`='数据库名' and `TABLE_NAME`= ...

  9. OpenSSL-Win32,rsa,私钥,公钥,1024,2048

    默认是rsa_private_key1024.pem , PEM格式私钥,C# ,PHP 用. 再生成 pkcs8 格式私钥, JAVA 用. 公钥无格式区分. 1024 的: openssl.exe ...

  10. 6.8 出口条件循环:do while

    while循环和for循环都是入口条件循环,即在循环的每次迭代之前检查测试条件,所以有可能根本不执行循环体中的内容.C语言还有出口条件循环(exit-condition loop),即在循环的每次迭代 ...