zoukankan      html  css  js  c++  java
  • decodeURIComponent() 解碼函数/二進制字符解碼&encodeURIComponent()

     ---獲取頁面傳值,若為漢字二進制字符可使用decodeURIComponent()解碼

           --var Emp_name = GetQuery('Emp_name'); 取值
         --var Wdate = GetQuery('Wdate');取值

    語法
    decodeURIComponent(URIstring):URIstring 必需。一个字符串,含有编码 URI 组件或其他要解码的文本。
    decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码。

    <html>
    <body>

    <script type="text/javascript">

    var test1="http://www.w3school.com.cn/My first/"
    document.write(encodeURIComponent("1."+test1)+ "<br />")
    document.write(decodeURIComponent("2."+test1))

    </script>

    </body>
    </html>

    輸出:
    1.http%3A%2F%2Fwww.w3school.com.cn%2FMy%20first%2F
    2.http://www.w3school.com.cn/My first/
  • 相关阅读:
    云计算-MapReduce
    云计算--hbase shell
    云计算--hdfs dfs 命令
    云计算--MPI
    jQuery 效果
    jQuery 效果
    JQuery效果隐藏/显示
    JQuery教程
    六级啊啊啊
    jQuery 安装
  • 原文地址:https://www.cnblogs.com/popo1/p/12529608.html
Copyright © 2011-2022 走看看