encodeURIComponent(text)
Encodes a URI component by replacing certain characters with escape sequences representing the UTF-8 encoding. Unlike encodeURI, it also encodes characters such as ?, =, & and /, making it suitable for encoding individual components of a URL.
Encodes as in standard JavaScript: a space becomes %20, hex digits are upper case (%3F), and A–Z a–z 0–9 - _ . ! ~ * ' ( ) are left as they are. Because ' is not encoded, put the value in an attribute with double quotes (href="…"), never single quotes. null and undefined return null.
Earlier versions of Docly encoded like an HTML form (a space became +). decodeURIComponent no longer turns + into a space either; read values that were stored that way with urlDecode(). For form encoding, use urlEncode().
Parameters
textstringrequiredText to encode
Returns
An encoded string.
Example
#write(encodeURIComponent("https://testing.com?quotes=\"\""))#https%3A%2F%2Ftesting.com%3Fquotes%3D%22%22