发布时间:2014-01-02 12:07:35作者:知识屋
先前有一朋友做了个网站,但是有担心别人复制他的网站内容和源代码,就问怎么样才能防止人家看他网站的源码?(其实谁愿意看他网站哇……呵呵 开玩笑的啦)对于防止别人看网页源代码的方法,一般现在能通过一些方法能够实现,下面,炬点就简单为大家分析一下吧。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
< html > < head > < script language = "javascript" > function clear(){ Source=document.body.firstChild.data; document.open(); document.close(); document.title="看不到源代码"; document.body.innerHTML=Source; } </ script > </ head > < body onload = clear ()> <!-- <a href="http://www.jdkjweb.com>炬点网</a>源代码好像是不让看的!--> </ body > </ html > |
1
2
3
4
5
6
7
|
<SCRIPT language=javascript> function click() { if (event.button==2) { alert('对不起,禁止使用此功能^_^.') } } document.onmousedown=click </SCRIPT> <script language= "JavaScript" > <!-- locate = 0; function scroller() { if (locate !=500 ) { locate++; scroll(0,locate); clearTimeout(timer); var timer = setTimeout( "scroller()" ,3); timer; } } // --> </script> |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<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
2
3
4
5
6
7
|
< Script Language=java script> function Click(){ alert( '版权所有(C)XXXltd.' ); window.event.returnValue= false ; } document.oncontextmenu=Click; < /Script> |
1
2
3
4
5
6
7
8
9
10
11
12
13
|
< Head> < Object id=closes type= "application/x-oleobject" classid= "clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" > < Param name= "Command" value= "Close" > < /Object> < /Head> < Body> < Script Language=java script> closes.Click() window.open( "网页文件名.htm" , "" , "menubar=no,location=no, scrollbars=yes,resizable=yes" ) < /Script> < /Body> |
2014-11-19
怎么找回退出的QQ群的群号?
Winpcap是什么 Winpcap有什么用?
jsp文件怎么打开?
百度权重之我见~ 百度权重的等级划分
DEDE关于列表页分页和内容页分页与CSS不对应,错位的问题-DedeCM
怎样去掉dedecms【织梦】后台的安全提示?
帝国CMS 后台在线编辑CSS扩展修改教程!(建议收藏)
修改Dede友情链接dede:flink
nginx做下载服务器配置一例