博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

Posted on 2009-04-23 09:00  linFen  阅读(549)  评论(1编辑  收藏  举报
<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>