zoukankan      html  css  js  c++  java
  • url 汉字乱码全方位解析

    <html>
    <head>
    <script>
     
     var encode = escape('排行');
     alert(encode);
     alert('排行');
     function covert(){
      var z = document.getElementById('dd').value;
      document.getElementById('ecode').value = escape(z);
     }
     function uncovert(){
      var z = document.getElementById('dd1').value;
      document.getElementById('ecode1').value = unescape(z);
     }

    function encodeURIComponent1(){
      alert('ddd');
      var z = document.getElementById('dd2').value;
      document.getElementById('ecode2').value = encodeURIComponent(z);
     }
    function encodeURI1(){  
      var z = document.getElementById('dd3').value;
      document.getElementById('ecode3').value = encodeURI(z);
     }

    function decodeURI1(){  
      var z = document.getElementById('dd4').value;
      document.getElementById('ecode4').value = decodeURI(z);
     }
     
    </script>
    </head>
    <body>
    <br/>
    <input id = 'dd' type ="text" value ='' style="100px;"/>
    <input id= "button" type ="button" value="转换" onclick="covert();"/>
    <input id = 'ecode' type ="text" value =''/>
    <br/>
    <input id = 'dd1' type ="text" value =''/>
    <input id= "unbutton" type ="button" value="反转换" onclick="uncovert();"/>
    <input id = 'ecode1' type ="text" value =''/>
    <br/>
    <input id = 'dd2' type ="text" value =''/>
    <input id= "unbutton1" type ="button" value="encodeURIComponent" onclick="encodeURIComponent1();"/>
    <input id = 'ecode2' type ="text" value =''/>
    <br/>
    <input id = 'dd3' type ="text" value =''/>
    <input id= "unbutton2" type ="button" value="encodeURI" onclick="encodeURI1();"/>
    <input id = 'ecode3' type ="text" value =''/>
    <br/>
    <input id = 'dd4' type ="text" value =''/>
    <input id= "unbutton3" type ="button" value="decodeURI" onclick="decodeURI1();"/>
    <input id = 'ecode4' type ="text" value =''/>

    <a id = "a1" href = "a.html?id=排行">a</a>
    </body>
    </html>

    微软BI技术交流群:316744959 武汉NET技术群:961108969 NET技术群:21386099 本人具有丰富的系统开发经验,承接系统开发,小程序,NET系统开发,BI开发,有需求联系微信手机:15010195887
  • 相关阅读:
    吴裕雄--天生自然 诗经:离思五首·其四
    吴裕雄--天生自然 诗经:江城子·乙卯正月二十日夜记梦
    CentOS6—启动httpd失败—Certificate has expired
    paper—SCI—Examples of author responses to reviewer comments
    paper—SCI答复审稿人的回信技巧
    mysql android—Installation using AndroPHP
    linux socket c : send data when socket close—SIGPIPE, Broken pipe
    Firefox:曾经打破黑暗的产品
    mysql中datetime到time_t转换
    mysql datetime 时间比较
  • 原文地址:https://www.cnblogs.com/Impulse/p/2239626.html
Copyright © 2011-2022 走看看