<!--禁止鼠标右键代码-->;<noscript><ifra;<scriptlanguage=javas;<!--;if(window.Event);document.captureEvents(E;functionnocontextmenu(){;event.cancelBubble=true;event.ret

 

<!--禁止鼠标右键代码-->

<noscript><iframe src=*.html></iframe></noscript>

<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>

 

1.将彻底屏蔽鼠标右键,无右键菜单

<body oncontextmenu="window.event.returnvalue=false">

 

也可以用于网页中Table框架中

<table border oncontextmenu=return(false)><td>no</table>

 

2.取消选取、防止复制

<body onselectstart="return false">

 

3.不准粘贴

<body onpaste="return false">

 

4.防止复制

<body oncopy="return false;" oncut="return false;">

 

5.IE地址栏前换成自己的图标

<link rel="Shortcut Icon" href="favicon.ico">

 

说明:关于favicon.ico文件的制作。你可以先在FW中做一个图片,属于你自

己站点一个小图标。然后在ACD see将文件属性改为*.ico,然后将你做的*.ICO

文件传到你的服务器目录中,然后就可以使用以上代码来实现,当别人登陆你的

站点时,地址栏里使用 的就是你自定义的图标了。很PP哦。

 

6.可以在收藏夹中显示出你的图标

在网页的〈head〉〈/head〉间加入以下语句:

〈link rel="shortcuticon" href="http://…/icon.ico"〉

 

即可。其中 icon.ico 为 16x16 的图标文件,

颜色不要超过 16 色。

 

说明:制作方法和上面的一样。只是显示的方式不同,这个是在别人收藏你的网

页地址时显示的个性图标。也很PP.

 

7.关闭输入法

<input style="ime-mode:disabled">

 

说明:这段代码是在表格提交时用到的。也就是在输入数据时不可以使用其他输

入法模式。

 

网页经典代码(二)

 

8.永远都会带着框架

 

<script language="javascript"><!--

if (window == top)top.location.href = "frames.htm";// --></script>

 

说明:frames.htm为你的网页,这也是保护页面的一种方法

 

9.防止被人frame

 

<SCRIPT LANGUAGE=javascript><!--

if (top.location != self.location)top.location=self.location;

// --></SCRIPT>

 

10.网页将不能被另存为

 

<noscript><iframe src=*.html></iframe></noscript>

说明:<noscirpt>的用法很广,其中一条就是可以使JS广告失效。

 

11.查源文件

 

<input type=button value=查看网页源代码

onclick="window.location = 'view-source:'+

'http://www.e3i5.com/test.htm';">

 

12.COOKIE脚本记录,有很大的用处哦

 

function get_cookie(Name) {

var search = Name + "="

 

var returnvalue = "";

 

if (documents.cookie.length > 0) {

 

offset = documents.cookie.indexOf(search)

 

if (offset != -1) { // if cookie exists

 

offset += search.length

 

// set index of beginning of value

 

end = documents.cookie.indexOf(";", offset);

 

// set index of end of cookie value

 

if (end == -1)

 

end = documents.cookie.length;

 

returnvalue=unescape(documents.cookie.substring(offset, end))

 

}

 

}

 

return returnvalue;

 

}

 

 

function loadpopup(){

 

if (get_cookie('popped')==''){

 

openpopup()

 

documents.cookie="popped=yes"

 

}

 

}

 

说明:以上是JS代码,请自己加起始符和结束符

<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>

 

<noscript>

<iframe src="*.htm"></iframe>

</noscript><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>

以上是禁止右键和另存为

 

3、让页面文字不被选中和复制

<body onselectstart="return false">

<body oncopy=alert(’对不起,禁止复制!’);event.returnvalue=false;>

 

除非你做的是框架式结构的网站 再加上 网页将不能被另存为

<noscript><iframe src=*.html></iframe></noscript>

说明:<noscirpt>的用法很广,其中一条就是可以使JS广告失效。 <!--禁止鼠标右键代码-->

<noscript><iframe src=*.html></iframe></noscript>

<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=n;document.onmousedown=nor;//-->;</script>;保证可以;1.利用弹出窗口封锁鼠标右键;<scriptlanguage=";(event.button==2){alert(;^_^')}}document.onmo;2.彻底封锁鼠标右键

 

document.oncontextmenu = nocontextmenu; // for IE5+

document.onmousedown = norightclick; // for all others

//-->

</script>

保证可以。

1.利用弹出窗口封锁鼠标右键

<script language="javascript">function click() {if

(event.button==2) {alert('本站不准使用右键,使用左键吧!

^_^')}}document.onmousedown=click</script>

2.彻底封锁鼠标右键

<script>

function

DM(e){if(!ns){if(event.button>1)window.external.addFavorite

('http://www.popunet.com/,' 大众网络报')}else{if(e.which>1)return false}}ns=navigator.appName=="Netscape";if(ns)document.captureEvents (Event.MOUSEMOVE|Event.MOUSEDOWN);document.onmousemove=DM;document. onmousedown=DM;</script>

3.禁止查看源文件

 

<script language="JavaScript">

<!--document.onmousedown=click function click() {

if ( event.button==2) {alert('不准查看源文件') }

if ( event.button==3) {alert('不准查看源文件') }}

//--></script>

其实这个想法根本就实现不了,你要是不想被人家复制,最好的办法就是不放在网上,这些代码都是些自欺欺人的方法,放弃这个念头吧!

禁止查看源代码[保护您的源代码]

 

====1、将以下代码加入到HEML的<body></body>之间

 

<SCRIPT language=javascript>

function click() {if (event.button==2) {alert('不许你偷看!

');}}document.onmousedown=click

</SCRIPT>

posted on 2016-10-28 15:47  飘渺的悠远  阅读(9234)  评论(0编辑  收藏  举报