用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;
}
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- javascript eval和JSON之间的联系
- javascript 面向对象技术基础教程
- js下用gb2312编码解码实现方法
- JavaScript 学习笔记(七)字符串的连接
- JavaScript 学习笔记(六)
- JavaScript 学习笔记(五)
- JavaScript 学习笔记(四)
- javascript showModalDialog模态对话框使用说明
- JavaScript 井字棋人工智能实现代码
- javascript控制frame,iframe的src属性代码
- 让IE8支持DOM 2(不用框架!)
- javascript 获取表单file全路径
- JavaScript 模拟用户单击事件
- js监听表单value的修改同步问题,跨浏览器支持
- js跟随滚动条滚动浮动代码
- Javascript的匿名函数小结
- JavaScript 对Cookie 操作的封装小结
- Javascript的闭包
- javascript Onunload与Onbeforeunload使用小结