JavaScript decodeURIComponent() Function
- Previous Page decodeURI()
- Next Page encodeURI()
- Go Up One Level JavaScript Global Reference Manual
Definition and Usage
decodeURIComponent()
The function decodes URI components.
Tip:Use encodeURIComponent()
The function encodes URI components.
Example
Encoded and Decoded URI:
var uri = "https://codew3c.com/my test.asp?name=ståle&car=saab"; var uri_enc = encodeURIComponent(uri); var uri_dec = decodeURIComponent(uri_enc); var res = uri_enc + "<br>" + uri_dec;
Syntax
decodeURIComponent(uri)
Parameter Value
Parameter | Description |
---|---|
uri | Mandatory. The URI to be decoded. |
Technical Details
Return Value: | String representing the decoded URI. |
---|
Browser Support
Function | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
decodeURIComponent() | Support | Support | Support | Support | Support |
- Previous Page decodeURI()
- Next Page encodeURI()
- Go Up One Level JavaScript Global Reference Manual