现在的位置: 首页 > 综合 > 正文

运用JavaScript禁止别人查看网页的源代码

2014年06月24日 ⁄ 综合 ⁄ 共 356字 ⁄ 字号 评论关闭

利用JavaScript让你的网页看不到源代码,也就是点击“查看源代码”后文本是空的,什么也看不到,有意思吧?这样别人就什么也看不到你网页所调用的资源了!


<html>
<head>
<title>让你的网页源代码不可见</title>
<script>
function clear(){
Source=document.body.firstChild.data;
document.open();
document.close();
document.title="没有源码";
document.body.innerHTML=Source;
}</script>
</head>
<body onload=clear()>
<!--
<marquee>很不错吧?让你的网页看不到源代码?</marquee>
-->
</body>
</html>

抱歉!评论已关闭.