用javascript实现源代码的隐藏与解密的方法

  作者:bea

<html> <head> <script language="javascript"><!-- function clear(){ Source=document.body.firstChild.data; document.open(); document.close(); document.title="看不到源代码"; document.body.innerHTML=Source; } // --></scrip


<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()>
<!--
当然了,行家真正要查看源代码,还是有办法的,比如在地址栏中输入,

javascript:alert(document.documentElement.outerHTML);
-->
</body>
</html>




[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]

主要是用到了这段代码,以前发布过类似的文章。


代码如下:


function clear(){
Source=document.body.firstChild.data;
document.open();
document.close();
document.title="看不到源代码";
document.body.innerHTML=Source;
}




有用  |  无用

猜你喜欢