JavaScript decodeURI() Function
JavaScript Global Functions
Definition and Usage
The decodeURI() function decodes a URI encoded by the encodeURI() function.
Tip: Use encodeURI() The function can encode a URI.
Syntax
decodeURI(uri)
| Parameters | Description |
|---|---|
| uri | Required. A string containing the URI to be decoded or other text to be decoded. |
Browser support





The decodeURI() function is supported by all major browsers
Example
Example
Use decodeURI() to decode an encoded URI:
var
uri
=
"
my test.php?name=ståle&car=saab
"
;
document
.
write
(
encodeURI
(
uri
)
"
"
)
;
document
.
write
(
decodeURI
(
uri
)
)
;
The output of the above example is:
my%20test.php?name=st%C3%A5le&car=saab
my test.php?name=ståle&car=saab
Try it »
JavaScript Global Functions