English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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).
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;
All browsers fully support the encodeURIComponent() function:
Function | |||||
decodeURIComponent() | Is | Is | Is | Is | Is |
Parameter | Description |
---|---|
uri | The URI component to be decoded |
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 |