{{jsSidebar("Objects")}}
The deprecated 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 {{jsxref("escape")}}. Because unescape
is deprecated, use {{jsxref("decodeURI")}} or {{jsxref("decodeURIComponent")}} instead.
Note: Do not use
unescape
to decode URIs, use decodeURI
instead.Syntax
unescape(str)
Parameters
str
- A string to be decoded.
Description
The unescape
function is a property of the global object.
Examples
unescape("abc123"); // "abc123" unescape("%E4%F6%FC"); // "äöü" unescape("%u0107"); // "ć"
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('ES1', '#sec-15.1.2.5', 'unescape')}} | {{Spec2('ES1')}} | Initial definition. |
{{SpecName('ES5.1', '#sec-B.2.2', 'unescape')}} | {{Spec2('ES5.1')}} | Defined in the (informative) Compatibility Annex B |
{{SpecName('ES6', '#sec-unescape-string', 'unescape')}} | {{Spec2('ES6')}} | Defined in the (normative) Annex B for Additional ECMAScript Features for Web Browsers |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
See also
- {{jsxref("decodeURI")}}
- {{jsxref("decodeURIComponent")}}