encodeURI(text) Last updated: 13. Nov 2023
Encodes a URI by replacing certain characters by escape sequences representing the UTF-8 encoding of the characters.
Parameters
Name | Type | Description |
---|---|---|
text | string | Text to encode |
Returns
An encoded string.
Example
Code example (#JS)
#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.#write(encodeURI("https://testing.com?quotes=\"\""))#
Output
The #JS code above produces the output shown below:https://testing.com?quotes=%22%22