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 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中加入以下代码: 复制代码代码如下: $(‘#myVideo’).bind(‘contextmenu’,function() { return false; }); 其中myVideo为video标签的id,这样就可以屏蔽video标签...
主要介绍了JS实现屏蔽网页右键复制及ctrl+c复制的方法,结合实例形式分析了2种比较常用的屏蔽复制功能的技巧,需要的朋友可以参考下
–禁止网页另存为: –> <noscript><iframe src=*.html></iframe></noscript> <!– 禁止选择文本: –> [removed] var omitformtags=[“input”, “textarea”, “select”] omitformtags=...
遇到网页上有精美图片或者精彩文字想保存时,通常大家都是选中目标后按鼠标右键,在弹出菜单中选择“图片另存为”或“复制”来达到我们的目的。但是,目前有许多网页都屏蔽了鼠标右键,那么用js如何实现禁止鼠标右键...
将之转换为 canvas(让浏览器认为不是图片以此禁止用户对之进行图片的操作,但无法阻止抓包) 禁止用户使用控制台查看源码(阻止浏览器打开控制台,但无法阻止抓包) 传输图片使用自定义格式(可以阻止抓包,但需要...
每当我们看到别人网页上的打开、打印、前进、另存为、后退、关闭本窗口、禁用右键等实现浏览器命令的链接,而自己苦于不能实现时,是不是感到很遗憾?是不是也想实现?如果能在网页上能实现浏览器的命令,将是多么...
可有时会遇到一些网页不允许用左键选取或拖动内容,也不让弹出右键菜单,以前也有人总结出多条办法来复制出网页内容(比如暂时禁用网页脚本,用word或frontpage编辑,在地址栏输入Javascript脚本,从源文件里复制...
4.1 禁用鼠标右键 4.2 使鼠标滚轮失效 4.3 状态栏显示鼠标位置 4.4 点击鼠标右键到指定页 4.5 鼠标放到图片上会显示另外一张图片 4.6 鼠标形状定义大全 4.7 鼠标移入移出时颜色变化 4.8 跟随鼠标的文字 4.9 跟随鼠标...
4.1 禁用鼠标右键 4.2 使鼠标滚轮失效 4.3 状态栏显示鼠标位置 4.4 点击鼠标右键到指定页 4.5 鼠标放到图片上会显示另外一张图片 4.6 鼠标形状定义大全 4.7 鼠标移入移出时颜色变化 4.8 跟随鼠标的文字 4.9 跟随鼠标...
也可以选择另存为纯文本。保留回车和换行符。说明在页面中选择文本,然后右键单击并单击“复制为纯文本...”,或使用扩展名弹出窗口中的按钮。应用内购买选项*使用快捷键ALT + C(或Mac Keyboard上的OPTION + C)来...
语言:English 记录何时安装,卸载,升级,启用或禁用扩展。 还跟踪每个chrome更新。 跟踪所有旧扩展,以及仍安装的扩展的当前...2018-09-12:(0.5)扩展程序包可以另存为CRX和/或ZIP文件。 所有扩展的当前权限列表显示