Right now, it is displayed as:
how %26 why
It should be:
how & why
The escape() function is deprecated. Use encodeURI() or encodeURIComponent() instead.
The unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. The escape sequences might be introduced by a function like escape . Usually, decodeURI or decodeURIComponent are preferred over unescape .
1. The unescape() function is used to decode that string encoded by the escape() function. The escape() function in JavaScript is used for encoding a string.
Definition and Usage 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.
That would be unescape()
.
2017 Edit: I should note that unescape()
has now been deprecated in favour of decodeURI()
and decodeURIComponent()
. Also, escape()
has been deprecated in favour of encodeURI
and encodeURIComponent()
respectively.
At least they are fairly obvious opposites.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With