Javascript examples for Global:escape
The escape() function encodes a string and was deprecated in JavaScript version 1.5. Use encodeURI() or encodeURIComponent() instead.
This function encodes special characters, with the exception of: * @ - _ + . /
Parameter | Description |
---|---|
string | Required. The string to be encoded |
A String, representing the encoded string
The following code shows how to Encode a string:
<!DOCTYPE html> <html> <body> <script> document.write(escape(" I^%&%%$%$# !")); </script>//from www . j a va 2s. com </body> </html>