Skip to content

Latest commit

 

History

History
63 lines (52 loc) · 1.59 KB

File metadata and controls

63 lines (52 loc) · 1.59 KB
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
devlang-javascript
language-reference
decodeURIComponent
JavaScript
TypeScript
DHTML
decodeURIComponent method
486ccee2-afd7-4863-97ce-4adb50cf39c0
11
mikejo5000
mikejo
ghogen

decodeURIComponent Function (JavaScript)

Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).

Syntax

decodeURIComponent(encodedURIString)  

Remarks

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.

Example

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  

Requirements

[!INCLUDEjsv55]

See Also

decodeURI Function
encodeURI Function