JavaScript Global Functions
The encodeURI() function is used to encode a URI.
This function encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters).
Tip: Use the decodeURI() function to decode an encoded URI.
| Parameter | Description |
|---|---|
| uri | Required. The URI to be encoded |
![]()
The encodeURI() function is supported in all major browsers.
Encode an URI:
The output of the code above will be:
JavaScript Global Functions
Your message has been sent to W3Schools.