Encode a string:
The output of the code above will be:
The escape() function was deprecated in JavaScript version 1.5. Use encodeURI() or encodeURIComponent() instead.
The escape() function encodes a string.
This function makes a string portable, so it can be transmitted across any network to any computer that supports ASCII characters.
This function encodes special characters, with the exception of: * @ - _ + . /
Function | |||||
---|---|---|---|---|---|
escape() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
string | Required. The string to be encoded |
Return Value: | A String, representing the encoded string |
---|