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

The JavaScript encodeURIComponent() Function

 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.

Syntax:

encodeURIComponent(uri)
var uri = "http://example.com/nxm.php?s=шеллы";
var en = encodeURIComponent(uri);

Browser Compatibility

All browsers fully support the encodeURIComponent() function:

Function
encodeURIComponent()IsIsIsIsIs

Parameter Value

ParameterDescription
uriThe URI component to be encoded

Technical Details

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

 JavaScript Global Properties/Function