JavaScript -- URL编码

----- 010-escape.html -----

 <!DOCTYPE html>
 <html>
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>标题</title>
 </head>
 <body>
 <script type="text/javascript">
     URI = "http://www.baidu.com/?#wd=关键字";
     document.write("原字符串 " + URI + "<br/><br/>");
     document.write("escape后 " + escape(URI) + "<br/>");
     document.write("unescape后 " + unescape(escape(URI)) + "<br/><br/>");
     document.write("encodeURI后 " + encodeURI(URI) + "<br/>");
     document.write("decodeURI后 " + decodeURI(encodeURI(URI)) + "<br/><br/>");
     document.write("encodeURIComponent后 " + encodeURIComponent(URI) + "<br/>");
     document.write("decodeURIComponent后 " + decodeURIComponent(encodeURIComponent(URI)) + "<br/>");
 </script>
 </body>
 </html>

JavaScript -- URL编码

上一篇:java方法重写和super关键字


下一篇:[Hadoop in Action] 第1章 Hadoop简介