JS 加码解码

<script>
//javascript加码解码
var objUrl = "http://www.iteye.com";
alert(encodeURI(objUrl));
alert(encodeURIComponent(objUrl));
var objUrl2 = "http%3A%2F%2Fwww.iteye.com";
alert(decodeURI(objUrl2));
alert(decodeURIComponent(objUrl2));
</script>

你可能感兴趣的:(JavaScript)