Encode a URI:
The result of res will be:
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.
Function | |||||
---|---|---|---|---|---|
encodeURI() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
uri | Required. The URI to be encoded |
Return Value: | A String, representing the encoded URI |
---|