清空代码防止查看源代码
2012-09-13 11:36
176 查看
<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()>
<!--
这招算是目前网上公布的防止查看源代码的方法中最好的了,当然了,要看还是办法的,比如在地址栏中输入<br>
javascript:alert(document.documentElement.outerHTML);
-->
</body>
</html>
文章出处:标准之路(http://www.aa25.cn/code/226.shtml)
备注:单独运行可以用,在其他程序中运行出错。待调试
<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()>
<!--
这招算是目前网上公布的防止查看源代码的方法中最好的了,当然了,要看还是办法的,比如在地址栏中输入<br>
javascript:alert(document.documentElement.outerHTML);
-->
</body>
</html>
文章出处:标准之路(http://www.aa25.cn/code/226.shtml)
备注:单独运行可以用,在其他程序中运行出错。待调试