<html>
<head>
<body>
<script language="JavaScript">
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</script>
点右键看看啊
</body>
</html>
解决方案 »
- extjs 打开窗体的布局是以viewport布局,如何在关闭viewport页面时提示,是否关闭
- 请教XMLHTTP
- 请js能人帮我看看这个基于javascript的mxGraph画流程图代码。
- JS 如何判断 是否为input标签 急!急!急!急!急!
- 请问高手!A页面怎么调用B页面table中的数据!
- javascript与session
- cookie是否存在
- 初学javascript 遇到问题求教!
- 请教两个关于比较的问题!
- 请问switch case 语句怎么写啊
- 在线请教--关于输入text框,影响其提交OK按钮的disabled状态---紧急
- view-source:http://sohu.com/ 的问题,请教
if (document.getElementById("imb_Background")==null){
document.body.innerHTML += " <iframe id=\"imb_Background\" src=\"about:blank\" style=\"position:absolute;left:0;top:0;width:0px;height:0px;visibility:hidden;\" frameborder=\"0\"> </iframe>";
window.imb_Background.document.open();
window.imb_Background.document.write(" <html><head>script>
function disabled(){document.oncontextmenu = new Function("event.returnValue=false;");
}</script></head> <body onload="disabled()" bgcolor=red> sdfasdfasdf </body> </html>");
window.imb_Background.document.close();
}
if (document.getElementById("imb_FormModal")==null){
document.body.innerHTML += " <iframe id=\"imb_FormModal\" src=\"about:blank\" style=\"position:absolute;left:0;top:0;width:0px;height:0px;visibility:hidden;border-bottom:2px solid #999999;border-right:2px solid #999999;border-top:1px solid #F8F6C1;border-left:1px solid #F8F6C1;\" frameborder=\"0\"> </iframe>";
window.imb_FormModal.document.open();
window.imb_FormModal.document.write(" <html> <head> <script>
function disabled(){document.oncontextmenu = new Function("event.returnValue=false;");
}</script><style> <!--");
window.imb_FormModal.document.write("td{font-size:12px;");
window.imb_FormModal.document.write("//--> </style> </head> <body onload="disabled()" scroll=no leftmargin=0 topmargin=0 oncontextmenu='return false'>");
window.imb_FormModal.document.write(" <table width=100% height=100% bgcolor=\"#eeeeee\"> <tr> <td align=left bgcolor=red> <div id=\"imb_Title\" style=\"padding-left:3px;padding-right:3px;color:white;font-family:verdana;\">");
window.imb_FormModal.document.write(" </div> </td> </tr> <tr> <td align=left> <div id=\"imb_Content\" style=\"padding:7px;\">");
window.imb_FormModal.document.write(" </div> </td> </tr> <tr> <td id=\"imb_Body\" align=center>");
window.imb_FormModal.document.write(" </td> </tr> </table>");
window.imb_FormModal.document.write(" </body> </html>");
window.imb_FormModal.document.close();
}试试上边的。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function StopRightButton()
{
if(document.all)
{
this.IContextMenuHander = function(){return false;};
document.attachEvent("oncontextmenu", this.IContextMenuHander);
}
else
{
this.IContextMenuHander = document.oncontextmenu;
document.oncontextmenu = function(){return false;}
}
}
</script>
</head>
<body onload="StopRightButton()">
<div id="as" style="width:600px;height:400px;background:#00FF99;"></div>
</body>
</html>