window.unescape

  • Revision slug: Web/API/window.unescape
  • Revision title: window.unescape
  • Revision id: 472191
  • Created:
  • Creator: iamanupmenon
  • Is current revision? No
  • Comment

Revision Content

{{DomRef}}

Summary

Decodes a value that has been encoded in hexadecimal (e.g., a cookie) including characters not escaped by window.escape.

Syntax

regular = window.unescape(escaped)
  • regular is the decoded string.
  • escaped is the encoded string.

Example

alert(unescape("%5C")); // displays "\"

Specification

{{DOM0}} Mentioned in a non-normative section of ECMA-262.

See also

Revision Source

<div>
  {{DomRef}}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>Decodes a value that has been encoded in hexadecimal (e.g., a cookie) including characters not escaped by <a href="/en-US/docs/Web/API/window.escape" title="/en-US/docs/Web/API/window.escape">window.escape</a>.</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
<i>regular</i> = window.unescape(<i>escaped</i>)
</pre>
<ul>
  <li><code>regular</code> is the decoded string.</li>
  <li><code>escaped</code> is the encoded string.</li>
</ul>
<h2 id="Example" name="Example">Example</h2>
<pre class="brush:js">
alert(unescape("%5C")); // displays "\"
</pre>
<h2 id="Specification" name="Specification">Specification</h2>
<p>{{DOM0}} Mentioned in a non-normative section of ECMA-262.</p>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/DOM/window.escape">window.escape</a></li>
  <li><a href="/en-US/docs/JavaScript/Reference/Global_Functions/decodeURIComponent">decodeURIComponent</a></li>
</ul>
Revert to this revision