function clickIE4()
{
if (event.button==2){
return false;
}
}function clickNS4(e)
{
if (document.layers||document.getElementById&&!document.all)
{
if (e.which==2||e.which==3){
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.οnmοusedοwn=clickNS4;
}
else if (document.all&&!document.getElementById){
document.οnmοusedοwn=clickIE4;
}document.οncοntextmenu=new Function("return false");
// disable the BackSpace(8), ALT+Left(37), ALT+Right(39), ALT+HOME(36), Enter (13), N(78), n(110)
var ALREADY_CHECKED = false;
function KeyIE4()
{
if(event != null){
var oSource = event.srcElement;
if (ALREADY_CHECKED) {
if ((oSource != null && (oSource.type=="text" || oSource.type=="textarea")) && ("8" == event.keyCode || "35" == event.keyCode || "36" == event.keyCode || "37" == event.keyCode || "39" == event.keyCode || "46" == event.keyCode || (event.ctrlKey && "88" == event.keyCode))) {
return true;
} else {
return false;
}
} else {
if("8" == event.keyCode && (oSource ==null || (oSource != null && oSource.type!="text" && oSource.type!="textarea"))){
return false;
} else if(event.altKey && ("36" == event.keyCode || "37" == event.keyCode || "39" == event.keyCode)){
return false;
}else if(event.ctrlKey && ("78" == event.keyCode || "110" == event.keyCode)){
return false; // Ctrl + N, restrict for now
}else if("13" == event.keyCode && (oSource ==null || (oSource != null && oSource.type!="textarea"))){
return false;
}else{
return true;
}
}
}
}document.onkeydown = KeyIE4;
document.onkeyup = KeyIE4;
js 屏蔽右键
原创mb5fb94c9d4a0ba 博主文章分类:java advanced ©著作权
©著作权归作者所有:来自51CTO博客作者mb5fb94c9d4a0ba的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:sesion applicaiton调用spring bean
下一篇:工作笔记2
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
屏蔽Flash右键信息的js代码
Yimin
html sed javascript xml 3c -
屏蔽左右键
1.在html的body区最后加入:<SCRIPT language=JavaScript> document.oncontextmenu=new Function("event.returnValue=false;"); docum
javascript ViewUI html Text 另存为 -
屏蔽IE右键功能
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HE
java javascript ViewUI HTML Click -
JS 屏蔽网页右键复制和ctrl+c复制
老是有些网站会屏蔽你的鼠标右键ml"><head><...
javascript xhtml ViewUI html xml