English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript decodeURIComponent() function

 JavaScript Global Properties/Function

decodeURIComponent()The function decodes the components of a Uniform Resource Identifier (URI).

Note:UsageencodeURIComponent()The function encodes the components of a Uniform Resource Identifier (URI).

Syntax:

decodeURIComponent(uri)
var uri = "http:"//example.com/nxm.php?s=шеллы";
var en = encodeURIComponent(uri);
var de = decodeURIComponent(en);
var ans = "Encoded URI: " + en + "<br>" + "Decoded URI: " + de;

Browser Compatibility

All browsers fully support the encodeURIComponent() function:

Function
decodeURIComponent()IsIsIsIsIs

Parameter Value

ParameterDescription
uriThe URI component to be decoded

Technical Details

Return value:A new string representing the decoded version of the given encoded URI component
Exception cases:Throws a URIError exception when used incorrectly
JavaScript Version:ECMAScript 1

 JavaScript Global Properties/Function