js urlencode

 

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
<script type="text/javascript"> 
var test1="分享"; 
var test2="%E5%88%86%E4%BA%AB"; 
document.write("编码<br/>"+test1+""+encodeURIComponent(test1)+ "<br />"); 
document.write("解码<br/>"+test2+""+decodeURIComponent(test2)); 
</script> 
 </body>
</html>

 

posted @ 2018-11-17 14:59  anobscureretreat  阅读(298)  评论(0)    收藏  举报