怎样才能把浏览器中的右击的弹出菜单中的“查看源文件”项屏蔽掉? 直接禁止右键行不行?<body oncontextmenu="return false;"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 以下程序不仅屏蔽右键,还屏蔽了 刷新 等多个按键,你再改改,效果更好!<script language=javascript><!--ie4 = (document.all) ? true : false;ns4 = (document.layers) ? true : false;function keyDown(e){if (ns4){var nKey=e.which;if (nKey==17) {document.write("请勿试图拷贝网页内容");window.alert("^_^");}if (ieKey==116) {document.write("对不起,本网页无法刷新");window.alert("^_^");}}if (ie4){var ieKey=event.keyCode;if (ieKey==17) {document.write("请勿试图拷贝网页内容");window.alert("^_^");}if (ieKey==116) {document.write("对不起,本网页无法刷新");window.alert("^_^");}}}document.onkeydown=keyDown;if (ns4) document.captureEvents(Event.KEYDOWN);//--></script> <script language=javascript>function click() { if (event.button!=1) {document.write("^_^");window.alert("^_^");}}document.onmousedown=click</script><SCRIPT language=JavaScript><!--function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);// --></SCRIPT><SCRIPT language=JavaScript><!--function click() {if(event.button==2){window.external.addFavorite('http://www.csdn.net,'中国软件网')}}document.onmousedown=clickfunction MM_displayStatusMsg(msgStr) { //v1.0 status=msgStr; document.MM_returnValue = true;}//--></script></head><body bgcolor="#000000" oncontextmenu=self.event.returnValue=false> <html><head><title禁止使用右键</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><SCRIPT language=JavaScript><!--curPage=1;document.oncontextmenu = function(){return false}if(document.layers) { window.captureEvents(Event.MOUSEDOWN); window.onmousedown = function(e){ if(e.target==document)return false; }}else { document.onmousedown = function(){return false}}//--></SCRIPT></head><body></body></html> to viking(海盗):你的例子好像没有限制刷新啊,不知是不是浏览器的问题,我的是Ie5.0 Ext TabPanel js或者jquery文本处理的问题,正确尝试中,但还是有几点做不出来 用js在文本框中添加字符 一个奇怪的问题,在线求解答 一段js代码,是实现一个动态菜单的。MF和IE都会报错。 框架页面之间的数组变量的传递如何实现? 表格问题,高难度! 问个打印的问题! 有关对象复制的问题? html5 audio标签与歌词同步问题----手机浏览器兼容 我在学习使用style过程中,编写以下这个网页但是总是出错。 怎样设定才能使body上下不能scroll,而左右方向上能scroll?
<script language=javascript>
<!--
ie4 = (document.all) ? true : false;
ns4 = (document.layers) ? true : false;
function keyDown(e)
{
if (ns4)
{var nKey=e.which;
if (nKey==17) {
document.write("请勿试图拷贝网页内容");
window.alert("^_^");
}
if (ieKey==116) {
document.write("对不起,本网页无法刷新");
window.alert("^_^");
}
}
if (ie4){var ieKey=event.keyCode;
if (ieKey==17) {
document.write("请勿试图拷贝网页内容");
window.alert("^_^");
}
if (ieKey==116) {
document.write("对不起,本网页无法刷新");
window.alert("^_^");
}
}
}
document.onkeydown=keyDown;
if (ns4) document.captureEvents(Event.KEYDOWN);
//-->
</script>
<script language=javascript>
function click() { if (event.button!=1) {
document.write("^_^");
window.alert("^_^");
}}
document.onmousedown=click
</script>
<SCRIPT language=JavaScript>
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
function click() {
if(event.button==2){
window.external.addFavorite('http://www.csdn.net,'中国软件网')
}
}
document.onmousedown=click
function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}
//-->
</script>
</head>
<body bgcolor="#000000" oncontextmenu=self.event.returnValue=false>
<head>
<title禁止使用右键</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT language=JavaScript>
<!--
curPage=1;
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}
//-->
</SCRIPT>
</head><body>
</body>
</html>