<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>地址编码转换</title>
<script type="text/javascript">
function UrlText()
{
var urlText = "网址编码";
document.write("编码前的字符串:"+urlText+"<br>");
var encodeText = escape(urlText);
document.write("编码后的字符串:"+ encodeText+"<br>");
document.write("解码后的字符串:"+unescape(encodeText)+"<br>");
}
</script>
</head>
<body οnlοad="UrlText();">
</body>
</html>
效果图: