<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> inc_dec</title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
  <script type="text/javascript">
  <!--
 function Encode()
 {
  var strRtn = escape(document.getElementById("taPlain").value);
  
  strRtn = strRtn.replace(/%/g,"\\");
  //alert(strRtn);
  document.getElementById("taEncoded").innerHTML = strRtn;
 }

 function Decode()
 {
  var strDec = document.getElementById("taEncoded").value;
  strDec = strDec.replace(/\\/g ,"%");
  document.getElementById("taPlain").value = unescape(strDec);
 }
 
  //-->
  </script>

  <input type="button" value="인코딩" onclick="Encode()">
  <input type="button" value="디코딩" onclick="Decode()">
  <br>
  <textarea id=taPlain rows=5 cols=70></textarea>
  <br>
  <textarea id=taEncoded rows=5 cols=70/></textarea>
 

 </body>
</html>

[출처] http://www.okjsp.pe.kr/seq/155961

 

+ Recent posts