Rookie Tutorial -- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Bookmarks
JavaScript Reference Manual
JavaScript Objects
- JavaScript Array Object
- JavaScript Boolean Object
- JavaScript Date Object
- JavaScript Math Object
- JavaScript Number Object
- JavaScript String Object
- JavaScript RegExp Object
- JavaScript Global Properties/Functions
- JavaScript Operators
- JavaScript Error
Browser Objects
DOM Objects
- HTML DOM Document Object
- HTML DOM Element Object
- HTML DOM Attribute Object
- HTML DOM Event Object
- HTML DOM Console Object
- CSSStyleDeclaration Object
- DOM HTMLCollection
HTML Objects
- <a>
- <area>
- <audio>
- <base>
- <blockquote>
- <body>
- <button>
- <canvas>
- <col>
- <colgroup>
- <datalist>
- <del>
- <details>
- <dialog>
- <embed>
- <fieldset>
- <form>
- <iframe>
- <frameset>
- <img>
- <ins>
- <input> - button
JavaScript decodeURIComponent() Function
Definition and Usage
The decodeURIComponent() function decodes a URI component encoded by the encodeURIComponent() function.
Note: If the URI component to be decoded is invalid, a URIError will be thrown.
Browser Support
All major browsers support the decodeURIComponent() function.
Syntax
decodeURIComponent(URI)
Parameter Values
| Parameter | Description |
|---|---|
| URI | Required. A string containing the URI component to be decoded. |
Return Value
A string representing the decoded URI component.
Technical Details
| JavaScript Version: | 1.5 |
|---|
Example
Decode a URI component:
var uri = "%7B%22name%22%3A%22John%22%7D";
var decoded = decodeURIComponent(uri);
console.log(decoded); // Output: {"name":"John"}
More Examples
Decode a URI with special characters:
var uri = "https%3A%2F%2Fexample.com%2Fpath%3Fquery%3Dvalue%26name%3D%C3%A9";
var decoded = decodeURIComponent(uri);
console.log(decoded); // Output: https://example.com/path?query=value&name=Γ©
YouTip