在线等 求大神 如何屏蔽由EXCEL转存为MHT格式的网页右键菜单

meema 2013-06-25 10:47:59
.mht文件通过iframe嵌入到父页面进行显示,现在能够屏蔽掉父页面的右键菜单,如何才能够屏蔽掉这个.mht文件的右键菜单呢?

<html>
<head>
<title>在线浏览</title>
<script type="text/javascript">
$().ready(function () { $(document).bind("contextmenu", function () { return false; }); alert("happy me"); $(document).bind("selectstart", function () { return false; }); $(document).keydown(function () { return key(arguments[0]) }); });
</script>
</head>
<body oncontextmenu='self.event.returnValue=false' ondragstart='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()' onselectstart="return false" >
<iframe border="0" id="DeptFrame" name="DeptFrame" marginwidth="1" marginheight="1" src="../../<%=.mht文件路径 %>"
frameborder="0" width="100%" height="100%" bordercolor="#EDEDED" scrolling="no">
</iframe>
</body>
</html>
...全文
76 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
meema 2013-06-25
  • 打赏
  • 举报
回复
那b页面应该怎么加载呢? 我这样子加载出来全是乱码啊

  $(function () {
            $("body").load("123.mht");
            //$("body").html("123.mht");
            document.title = window.name;
        });
_沫尘 2013-06-25
  • 打赏
  • 举报
回复
<iframe> 不要直接引用你的目标mht, 而先引用另一个页面 b ,在b页面的body中加载你的目标mht 然后在这个b页面的body上 <body oncontextmenu='self.event.returnValue=false' ondragstart='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()' onselectstart="return false" >

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧