JavaScript decodeURI () function
Definition and Usage
decodeURI () function can encodeURI () function to decode the encoded URI.
Tip: Use encodeURI () function can be encoded URI.
grammar
decodeURI(uri)
参数 | 描述 |
---|---|
uri | 必需。一个字符串,含有要解码的 URI 或其他要解码的文本。 |
Browser Support
The decodeURI () function is supported in all major browsers
Examples
Example
Use decodeURI () for a URI encoded decoding:
<script>
var uri="my test.asp?name=stale&car=saab";
document.write(encodeURI(uri)+ "<br>");
document.write(decodeURI(uri));
</script>
var uri="my test.asp?name=stale&car=saab";
document.write(encodeURI(uri)+ "<br>");
document.write(decodeURI(uri));
</script>
Examples of the above output:
my%20test.php?name=st%C3%A5le&car=saab
my test.asp?name=stale&car=saab
my test.asp?name=stale&car=saab
try it"
JavaScript Global Functions