代码如下: <html> <head> <meta http-equiv='content-type' content='text/html; charset=gb2312'> <title>url解码(decode)/编码(encode)</title> </head> <body> <center><font color=green size=+2>url解码(decode)/编码(encode)</font><br> 需要解码的字符串:<textarea id="string1" rows="10" cols="30"></textarea> 解码后的字符串:<textarea id="string2" rows="10" cols="30"></textarea><br> 需要编码的字符串:<textarea id="string3" rows="10" cols="30"></textarea> 编码后的字符串:<textarea id="string4" rows="10" cols="30"></textarea><br> <input type="button" id="decode" value="解码(decode)" onclick="javascript:string2.value=decodeuri(string1.value);"> <input type="button" id="encode" value="编码(encode)" onclick="javascript:string4.value=encodeuri(string3.value);"> </center> </body> </html> [ctrl+a 全选 提示:你可先修改部分代码,再点运行代码]
本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)