javascript encoding

escape(), encodeURI() 등 차이

http://realmind.tistory.com/entry/Javascript-Escape-Encoder-v01

 

<html>
<head>
<script>
  function encode(){
    var original = document.forms[0].original.value;
    var encoded = encodeURI(original);
    document.forms[0].encoded.value = encoded;
  }
</script>
</head>
<body>
<form name="form">
<input type="text" name="original" width="100%"/><br/>
<input type="text" name="encoded" width="100%"/><br/>
<a href="javascript:encode()">encode</a>
</form>
</body>
</html>