当前位置: 首页 > 网络学院 > 客户端脚本教程 > JavaScript > JavaScript decodeURI() 方法
The decodeURI() function decodes a URI encoded with the encodeURI() function.
decodeURI()方法可以编译一串URI,encodeURI()可以反编译
decodeURI(URIstring) |
Parameter 参数 | Description 注释 |
---|---|
URIstring URI字符串 | Required. The URI to be decoded 必选项。所要编译的URI |
In this example we use decodeURI() to decode a URI after encoding it:
在下面的例子中,我们用decodeURI()来反编译一个已编译的URI:
<script type="text/javascript"> var test1="http://www.ruanchen.com/My first/" document.write(encodeURI(test1)+ "<br />") </script> |
The output of the code above will be:
输出结果为:
http://www.ruanchen.com/My%20first/ |
decodeURI()
How to use decodeURI() to decode a URI after encoding it.
如何用decodeURI()来编译一个已被编译的URI