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

JavaScript encodeURI() Function

 JavaScript Global Properties/Function

encodeURI()The function encodes Uniform Resource Identifiers (URI).

Note:UsageencodeURI()The function can decode Uniform Resource Identifiers (URI).

Syntax:

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;

Browser Compatibility

All browsers fully support the encodeURI() function:

Function
encodeURI()IsIsIsIsIs

Parameter Value

ParameterDescription
uriThe URI to be encoded

Technical Details

Return Value:Returns a new string representing the encoded version of the given URI
JavaScript Version:ECMAScript 1

 JavaScript Global Properties/Function