Right now, it is displayed as:
how %26 why
It should be:
how & why
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.
Try unescape()
Note:
The deprecated unescape()
method 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. Because unescape is deprecated, use decodeURI or decodeURIComponent instead.
you can use unescape to remove escape characters.
Moreover, unescape/escape is not deprecated over decodeURL/encodeURL . but decodeURL/encodeURL is preferable to decode/encode URL.