• 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
  • 相关阅读:
    HTML+CSS,让div在屏幕中居中(水平居中+垂直居中)方法总结
    HTML+CSS,让div在屏幕中居中(水平居中+垂直居中)方法总结
    How to set the Default Page in ASP.NET?
    百练1089:数字反转
    百练1089:数字反转
    【分治的典型应用:归并排序】
    【分治的典型应用:归并排序】
    【分治的典型应用:归并排序】
    【分治的典型应用:快速排序】
    【分治的典型应用:快速排序】
  • 原文地址:https://www.cnblogs.com/Impulse/p/2239626.html
Copyright © 2020-2023  润新知