According to W3 Schools the unescape() JavaScript function has been deprecated. The site states,
"The unescape() function was deprecated in JavaScript version 1.5. Use decodeURI() or decodeURIComponent() instead."
Should I go through and replace all instances of unescape()?
Is the deprecation of JavaScript functions something that web developers concern themselves with and actively update their JavaScript code?
or can I expect that most browsers will support JavaScript 1.5 in the foreseeable future?
The unescape() function is deprecated. Use decodeURI() or decodeURIComponent() 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 .
The escape() function is used to encode a string, making it safe for use in a URL. The unescape() function is used to decode an encoded string.
According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape you should update your old scripts:
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.
Fixing it could be as simple as dropping a line into your JS to add in an unescape()
method if one doesn't exist.
window.unescape = window.unescape || window.decodeURI;
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