js escape && unescape 对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>
    var Words = "%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class%3D%22main%22%20id%3D%22app-main";
    var str3 = unescape(Words);
    var str4 = escape(str3);
    console.log(str4);
  </script>
 </body>
</html>

参考文献

posted @ 2017-10-17 11:28  hopher  阅读(594)  评论(0编辑  收藏  举报