| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
decodeURIComponent Function (JavaScript) | Microsoft Docs |
01/18/2017 |
windows-client-threshold |
|
language-reference |
|
|
|
486ccee2-afd7-4863-97ce-4adb50cf39c0 |
11 |
mikejo5000 |
mikejo |
ghogen |
Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
decodeURIComponent(encodedURIString)
The required encodedURIString argument is a value representing an encoded URI component.
A URIComponent is part of a complete URI.
If the encodedURIString is not valid, a URIError occurs.
The following code first encodes and then decodes a URI.
var uriEncode = encodeURI ("http://www.Not a URL.com");
var uriDecode = decodeURIComponent(uriEncode);
document.write (uriEncode);
document.write("<br/>");
document.write (uriDecode);
// Output:
// http://www.Not%20a%20URL.com
// http://www.Not a URL.com [!INCLUDEjsv55]