这招算是目前网上公布的防止查看源代码的方法中最好的了,当然了,要看还是办法的,比如在地址栏中输
入"javascript:alert(document.documentElement.outerHTML);"。
但好像测试了几下,简单的没多少代码的还行,对于JS较多的,就不行了。
<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 οnlοad=clear()>
<!--
<a href="http://www.zgsj.com">中国数据</a>可惜你看不到!
-->
</body>
</html>
入"javascript:alert(document.documentElement.outerHTML);"。
但好像测试了几下,简单的没多少代码的还行,对于JS较多的,就不行了。
<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 οnlοad=clear()>
<!--
<a href="http://www.zgsj.com">中国数据</a>可惜你看不到!
-->
</body>
</html>