防止页面内容的复制、选取和右键屏蔽
2007-10-24 13:18
381 查看
通过下面的代码,即可实现页面全屏蔽功能:
<DIV id=divTitle style="FONT-SIZE: 16px">禁止复制代码1</DIV>
<SCRIPT LANGUAGE=javascript>
function click() {
alert('禁止你的左键复制!') }
function click1() {
if (event.button==2) {alert('禁止右键点击~!') }}
function CtrlKeyDown(){
if (event.ctrlKey) {alert('不当的拷贝将损害您的系统!') }}
document.onkeydown=CtrlKeyDown;
document.onselectstart=click;
document.onmousedown=click1;
</SCRIPT>
<SCRIPT language=javascript></SCRIPT>
<DIV id=divTitle style="FONT-SIZE: 16px">禁止复制代码2</DIV>
<script language="JavaScript" type="text/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>
</head>
<body leftmargin=0 topmargin=0 onmousemove='HideMenu()' oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()">
<noscript><iframe src=*></iframe></noscript>
// 彻底屏蔽右键菜单
document.oncontextmenu = function()
{
window.event.returnvalue=false;
alert("对话框内容");
return false;
}
或者:
在<body>中加入以下代码: 效果等价(我感觉还是加下面的好,多容易啊)
<body onmousemove=/HideMenu()/ oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()">
<DIV id=divTitle style="FONT-SIZE: 16px">禁止复制代码1</DIV>
<SCRIPT LANGUAGE=javascript>
function click() {
alert('禁止你的左键复制!') }
function click1() {
if (event.button==2) {alert('禁止右键点击~!') }}
function CtrlKeyDown(){
if (event.ctrlKey) {alert('不当的拷贝将损害您的系统!') }}
document.onkeydown=CtrlKeyDown;
document.onselectstart=click;
document.onmousedown=click1;
</SCRIPT>
<SCRIPT language=javascript></SCRIPT>
<DIV id=divTitle style="FONT-SIZE: 16px">禁止复制代码2</DIV>
<script language="JavaScript" type="text/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>
</head>
<body leftmargin=0 topmargin=0 onmousemove='HideMenu()' oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()">
<noscript><iframe src=*></iframe></noscript>
// 彻底屏蔽右键菜单
document.oncontextmenu = function()
{
window.event.returnvalue=false;
alert("对话框内容");
return false;
}
或者:
在<body>中加入以下代码: 效果等价(我感觉还是加下面的好,多容易啊)
<body onmousemove=/HideMenu()/ oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()">
相关文章推荐
- 40个js小技巧:屏蔽鼠标右键、取消选取、防止复制、粘贴、转换地址栏图标
- 40个js小技巧:屏蔽鼠标右键、取消选取、防止复制、粘贴、转换地址栏图标
- 转:js小技巧 ,将彻底屏蔽鼠标右键,可用于Table ,取消选取、防止复制,IE地址栏前换成自己的图标
- 右键屏蔽,防止复制,突破屏蔽鼠标右键复制网页内容
- js小技巧 ,将彻底屏蔽鼠标右键,可用于Table ,取消选取、防止复制,IE地址栏前换成自己的图标
- 网页防止另存为,屏蔽右键,防止复制代码,防止被人frame等网页代码
- javascript终极屏蔽右键/禁止复制/禁止另存/禁止右键/禁止选取/禁止粘贴的方法
- 如何突破屏蔽鼠标右键复制网页内容???
- JS实现JSP页面,鼠标禁止另存,复制,右键,选取
- web页面屏蔽右键菜单 左键选取
- WEB页面内容禁止选择、复制、右键等实现
- 禁止页面复制功能 js禁止复制 禁用页面右键菜单 屏蔽 F5 刷新键
- JS实现JSP页面,鼠标禁止另存,复制,右键,选取
- 屏蔽右键代码(防止网页恶意复制)
- 网页防止另存为,屏蔽右键,防止复制代码,防止被人frame等网页代码
- 禁止网页内容复制、选取、禁止右键菜单js代码
- 网页防止另存为,屏蔽右键,防止复制代码,防止被人frame等网页代码
- HTML页面内容禁止选择、复制、右键
- javascript---去除右键功能,防止复制和文本选取
- HTML页面内容禁止选择、复制、右键