清空代码防止查看源代码

[复制链接]
查看1156 | 回复0 | 2010-8-9 11:11:30 | 显示全部楼层 |阅读模式
  1. <html>
  2. <head>
  3. <script language="javascript">
  4. function clear(){
  5. Source=document.body.firstChild.data;
  6. document.open();
  7. document.close();
  8. document.title="看不到源代码";
  9. document.body.innerHTML=Source;
  10. }
  11. </script>
  12. </head>
  13. <body onload=clear()>
  14. <!--这招算是目前网上公布的防止查看源代码的方法中最好的了,当然了,要看还是办法的,比如在地址栏中输入<br>
  15. javascript:alert(document.documentElement.outerHTML);
  16. -->
  17. </body>
  18. </html>
复制代码


这招算是目前网上公布的防止查看源代码的方法中最好的了,当然了,要看还是办法的,比如在地址栏中输入
您需要登录后才可以回帖 登录 | 注册

本版积分规则