Javascript examples for Global:unescape
The unescape() function was deprecated in JavaScript version 1.5. Use decodeURI() or decodeURIComponent() instead.
The unescape() function decodes an encoded string.
Parameter | Description |
---|---|
string | Required. The string to be decoded |
A String, representing the decoded string
The following code shows how to Encode and decode a string:
<!DOCTYPE html> <html> <body> <script> var str="~!@#$%^&*()_+ java2s.com!"; var str_esc=escape(str);/*from ww w . j a v a 2s . c o m*/ document.write(str_esc + "<br>") document.write(unescape(str_esc)) </script> </body> </html>