zoukankan      html  css  js  c++  java
  • js加密(转载)

    <html>
    <head>
    <script src='PCASClass.js'></script>
    </head>
    <body>
    <input type=button onclick=encodes() value=压缩> <input type=button onclick=decodes() value=解压>
    <textarea id="ttt" rows=35 cols=120></textarea>
    <script>
    <!--

    PCAD
    =PCAD.replace("--请选择省份--$--请选择城市--,--请选择地区--#","")
    document.getElementById(
    "ttt").value=PCAD

    function decodes(){
    PCAD
    =document.getElementById("ttt").value
    for(i=0;i<PCAStore.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStore.substr(i,1),"g"),PCAStore.substr(i+1,1));
    for(i=0;i<PCAStead.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStead[i],"g"),PCAStead[i+1]);
    document.getElementById(
    "ttt").value=PCAD
    }


    function encodes(){
    PCAD
    =document.getElementById("ttt").value
    for(i=0;i<PCAStead.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStead[i+1].replace(/([|$])/,"\\$1"),"g"),PCAStead[i].replace("\\",""));
    for(i=0;i<PCAStore.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStore.substr(i+1,1),"g"),PCAStore.substr(i,1));
    document.getElementById(
    "ttt").value=PCAD
    }


    //-->
    </script>

    </body>

    转自:http://www.cnblogs.com/adam/archive/2009/08/25/1553551.html

  • 相关阅读:
    Vue.js学习笔记 第五篇 事件处理
    多sheet导出核心代码
    jeecg查询备份
    输入URL 一瞬间发生了什么
    get post 的区别
    Redis所需内存 超过可用内存怎么办
    MySQL联合索引
    常用的sql
    MySQL 时间类型字段的分析
    PHP各个版本的区别
  • 原文地址:https://www.cnblogs.com/johnwonder/p/1884186.html
Copyright © 2011-2022 走看看