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
  • 相关阅读:
    Thread.Join
    WPF几个基础概念的浅显理解
    Vue v-bind指令
    Vue设置路由跳转的两种方法: <router-link :to="..."> 和router.push(...)
    前端上传视频、图片、文件等大文件 组件Plupload使用指南
    vue如何获取并操作DOM元素
    css中border-sizing属性详解和应用
    vue使用axios发送post请求时的坑及解决原理
    vue中的js引入图片,使用require相关问题
    vue 动态添加body背景图片
  • 原文地址:https://www.cnblogs.com/Impulse/p/2239626.html
Copyright © 2011-2022 走看看