encodeURIComponent()


Overview

encodeURIComponent() is a JavaScript function used to encode URIs. It encodes special characters like: , / ? : @ & = + $ #.

Parameters

encodeURIComponent() can have a single parameter:

uri: the URI to be encoded.

Return possibilities

Returns the encoded URI.

Exemple

JavaScript
encodeURIComponent(https://csec.raided.eu/@hello#world)

This will encode the given URI.

See also

decodeURIComponent()
URI