oncontextmenu="window.event.returnValue=false" style="overflow-y: hidden; overflow-x: hidden"ajs9     leftmargin="0" topmargin="0"
<body oncontextmenu="return false"></body>
<!--禁止网页另存为: --> 
<noscript><iframe src=*.html></iframe></noscript>

<!-- 禁止选择文本: --> 
<script type="text/javascript">

var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){ 
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1) 
return false 
}

function reEnable(){ 
return true 
}

if (typeof document.onselectstart!="undefined") 
document.onselectstart=new Function ("return false") 
else{ 
document.onmousedown=disableselect 
document.onmouseup=reEnable 

</script>

<!-- 禁用右键: --> 
<script> 
function stop(){ 
return false; 

document.oncontextmenu=stop; 
</script>

1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键 
<table border oncontextmenu=return(false)><td>no</table> 可用于Table

2. <body onselectstart="return false"> 取消选取、防止复制

3. onpaste="return false" 不准粘贴

4. oncopy="return false;" oncut="return false;" 防止复制

5. <link rel="Shortcut Icon" href="favicon.ico"> IE地址栏前换成自己的图标

6. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标

7. <input style="ime-mode:-Disabled"> 关闭输入法

8. 永远都会带着框架 
<script language="javascript"><!-- 
if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页 
// --></script>

9. 防止被人frame 
<SCRIPT LANGUAGE=javascript><!-- 
if (top.location != self.location)top.location=self.location; 
// --></SCRIPT>

11. <input type=button value=查看网页源代码 
onclick="window.location = `view-source:`+ http://www.tonightdream.com/`";>

12.删除时确认 
<a href=`javascript:if(confirm("确实要删除吗?"location="boos.asp?&areyou=删除&page=1"`>删除</a>

13. 取得控件的绝对位置 
//javascript 
<script language="javascript"> 
function getIE(E){ 
var t=e.offsetTop; 
var l=e.offsetLeft; 
while(e=e.offsetParent){ 
t+=e.offsetTop; 
l+=e.offsetLeft;

<!--右键开始-->
<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>
<!-- 禁止选择文本: -->
<script type="text/javascript">

var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){ 
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1) 
return false 
}

function reEnable(){ 
return true 
}

if (typeof document.onselectstart!="undefined") 
document.onselectstart=new Function ("return false") 
else{ 
document.onmousedown=disableselect 
document.onmouseup=reEnable 

   </script>

<script language="javascript" type="text/javascript">
<!--
function key(){ 
if(event.shiftKey){
window.close();}
//禁止shift
if(event.altKey){
window.close();}
//禁止alt
if(event.ctrlKey){
window.close();}
//禁止ctrl
return false;}
//document.onkeydown=key;
if (window.Event)
document.captureEvents(Event.MOUSEUP);
//swordmaple javascript article.
//from http://www.jx165.com/
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>

---------------

要真正禁止打印页面是办不到的,但是如果能设置让用户打印到的是空白,也算是实现禁止打印的目的了

<html> 
<head><title>不可打印的页面</title> 
<style> 
@media print{ 
body{display:none} 

</style> 
</head> 
<body> 
文档主要内容 
</html>

JS禁用右键,禁用打印,防止另存为,IE浏览器识别(转载)的更多相关文章

  1. JS禁用右键+禁用Ctrl+u+禁用F12

    第一种方法: , , ]; document.oncontextmenu = new Function("event.returnValue=false;"),//禁用右键 doc ...

  2. JS input文本框禁用右键和复制粘贴功能的代码

    代码如下: function click(e) { if (document.all) { ||||) { oncontextmenu='return false'; } } if (document ...

  3. H5_0003:JS禁用调试,禁用右键,监听F12事件的方法

    1,禁用调试 // 这个方法是防止恶意调试的 (function () { console["log"]("=============================== ...

  4. js 禁用右键菜单、拖拽、选中、复制

    //禁用拖拽 document.ondragstart = function () { return false; }; /** * 禁用右键菜单 */ document.oncontextmenu ...

  5. ecshop 中如何禁用右键和F12

    找到 网站根目录/themes/js/common.js,在最后加入如下代码: //禁用右键和F12 //方法一 document.oncontextmenu = function () { retu ...

  6. 帆软报表(finereport)禁用右键

    点击模板>模板web属性>(填报,数据分析,分页预览设置),选择为该模板单独设置,在下面的事件设置里面添加一个加载结束事件,完整js代码如下: 这段代码的基本原理是让用户的页面右键点击事件 ...

  7. 【CefSharp】 禁用右键菜单 与 控制弹出窗口的方式(限版本39.0.0.1)

    这周没什么时间,一开始就在忙一些CefSharp的事情,Win10的研究就放了下来,CefSharp的资料挺少的,但好在是开源的,可以我们便宜的折腾.因为两个的内容都不多,我就合成一篇文章啦. 这还里 ...

  8. WebBrowser 禁用右键

    禁用错误脚本提示 将 WebBrowser控件的 ScriptErrorsSuppressed 设为 true 禁用右键菜单 将 WebBrowser 的 IsWebBrowserContextMen ...

  9. TX Textcontrol 使用总结三——禁用右键、模版合并

    一.Tx Textcontrol如何禁用右键快捷菜单? ==> 添加txContent_TextContextMenuOpening事件,实现方式如下所示: private void txCon ...

随机推荐

  1. Closures in OOC

    Closures in OOC 接上一篇Complexity Behind Closure,这次来专注于Rock是如何在C里实现Closure的. 这篇文章同时发布在Github上. Block as ...

  2. make deb for debian/ubuntu, package software for debian/ubuntu

    here you may find useful information: =====================X8---------------------------------8X==== ...

  3. MySQL 的 phpmyadmin上传大小限制(转)以及 MySQL server has gone away 的解决办法

    phpmyadmin上传大小限制 原帖地址:http://www.hmidc.com/home/news/?13914.html 时间:2011-6-21 11:17:57  作者:红帽之家  来源: ...

  4. struts2标签库使用小结

    之前的demo中用了一些struts2标签,用的是struts2.2.1.1. Struts2的标签常常和OGNL(图对象导航语言)一起使用.有几点总结如下: [引用请注明出处:http://blog ...

  5. Android 权限管理

    从 Android 6.0(API 级别 23)开始,用户开始在应用运行时向其授予权限,而不是在应用安装时授予.此方法可以简化应用安装过程,因为用户在安装或更新应用时不需要授予权限.它还让用户可以对应 ...

  6. Oracle全角和半角处理函数

    1.TO_MULTI_BYTE语法: TO_MULTI_BYTE(String) 功能: 计算所有单字节字符都替换为等价的多字节字符的String.该函数只有当数据库字符集同时包含多字节和单字节的字符 ...

  7. 日志快速筛选 之 linux命令grep|uniq|wc|awk

    以前我个人的观念是,在线上运行的东西尽量不要记什么流水日志. 但是后来我变了,发现在线上记日志是一个绝对有必要的东西,尤其是在当下很流行的微服务的推动下,没有日志的帮助,犹如一个睁眼瞎,排查问题基本靠 ...

  8. EntityFramework Core Raw Query再叙注意事项

    前言 最近一直比较忙没有太多时间去更新博客,接下来会一直持续发表相关内容博客,上一篇我们讲到了EF Core中的原始查询,这节我们再来叙述一下原始查询,本文是基于在项目当中用到时发现的问题. 话题 我 ...

  9. [ios2]如何让IOS应用从容地崩溃 【转】

    文/donglin 虽然大家都不愿意看到程序崩溃,但可能崩溃是每个应用必须面对的现实,既然崩溃已经发生,无法阻挡了,那我们就让它崩也崩得淡定点吧. IOS SDK中提供了一个现成的函数 NSSetUn ...

  10. MySQL分表

    一.概念 1.为什么要分表和分区?日常开发中我们经常会遇到大表的情况,所谓的大表是指存储了百万级乃至千万级条记录的表.这样的表过于庞大,导致数据库在查询和插入的时候耗时太长,性能低下,如果涉及联合查询 ...