English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
JavaScript Global Properties/Function
encodeURI()The function encodes Uniform Resource Identifiers (URI).
Note:UsageencodeURI()The function can decode Uniform Resource Identifiers (URI).
encodeURI(uri)
var uri = "http://example.com/nxm.php?s=шеллы"; var en = encodeURI(uri); var de = decodeURI(en); var ans = "Encoded URI: " + en + "<br>" + "Decoded URI: " + de;
All browsers fully support the encodeURI() function:
Function | |||||
encodeURI() | Is | Is | Is | Is | Is |
Parameter | Description |
---|---|
uri | The URI to be encoded |
Return Value: | Returns a new string representing the encoded version of the given URI |
---|---|
JavaScript Version: | ECMAScript 1 |