网页加密WEB页代码

好么,当初我发这篇的时候CSDN博客还没有插入代码的编辑项呢是怎么的。


<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页加密</title>
<script language="javascript">
function encrypt()
{   // 加密
 var SourceCode;
 SourceCode=document.F1.S1.value;
 //alert(SourceCode);
 if(SourceCode=="") { alert("没有可以加密的代码![原始代码]框中没有内容。"); return; }
 document.F1.S2.value=encodeURIComponent(SourceCode);
}
function decode()
{   //译码
 var DecodeStr;
 DecodeStr=document.F1.S2.value;
 //alert(DecodeStr);
 if(DecodeStr=="") {alert("没有被加密的代码来还原![加密后代码]框中没有内容。"); return; }
 document.F1.S1.value=decodeURIComponent(DecodeStr);
}

function exchange()
{
 if(document.F1.R1[0].checked) encrypt();
 else if(document.F1.R1[1].checked ) decode();
 else alert("没选择“加密/解密”按扭");
}
</script>
</head>
<body bgcolor=#CCD6DF>
<h2 align="center"><font color="#000080">encodeURIComponent 网页加密</font></h2>
<form name="F1" action="" target="_blank" οnsubmit="exchange(); return false;">
 <div align="center">
 <table border="1" width="860" id="table1" height="213" bordercolorlight="#C0C0C0" bordercolordark="#808080">
  <tr>
   <td width="360" height="28">
   <p align="center"><b><font color="#000080">原始代码</font></b></td>
   <td width="103" height="28"> </td>
   <td height="28">
   <p align="center"><b><font color="#000080">加密后代码</font></b></td>
  </tr>
  <tr>
   <td width="360"><textarea rows="14" name="S1" cols="50"></textarea></td>
   <td width="103">
   <p align="center"><input type="radio" name="R1" checked>加密</p>
   <p align="center"><input type="radio" name="R1">解密</p>
   <p align="center"><input type="submit" value="<-执行->" name="B1"></p>
   </td>
   <td><textarea rows="14" name="S2" cols="50"></textarea></td>
  </tr>
  <tr>
   <td colspan="3"><br>
   <font face="宋体" color="#0000ff"><HTML><br>
   <HEAD><br>
   <meta http-equiv="Content-Language" content="zh-cn"><br>
   <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br>
   <title>加密</title><br>
   <script LANGUAGE="Javascript">document.write(unescape("<b><font color="#CC0000">[加密后代码]</font></b>"))</SCRIPT><br>
   </HEAD><br>
   <BODY><br>
   </BODY><br>
   </HTML></font><br>
 </td>
  </tr>
 </table>
 </div>
</form>
</body>
</html>


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值