English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
JavaScript Global Properties/Function
encodeURIComponent method ()The function encodes uniform resource identifiers (URI) components.
Note:UsageencodeURIComponent()The function can decode uniform resource identifiers (URI) components.
encodeURIComponent(uri)
var uri = "http://example.com/nxm.php?s=шеллы"; var en = encodeURIComponent(uri);
All browsers fully support the encodeURIComponent() function:
Function | |||||
encodeURIComponent() | Is | Is | Is | Is | Is |
Parameter | Description |
---|---|
uri | The URI component to be encoded |
Return Value: | A new string representing the encoded version of the given URI component |
---|---|
JavaScript Version: | ECMAScript 1 |