Decode a URI after encoding it:
let uri = "https://91xjr.com/my test.html?name=ståle&car=saab";
let encoded = encodeURIComponent(uri);
let decoded = decodeURIComponent(encoded);
Try it Yourself »
The decodeURIComponent()
method decodes a URI component.
Use the encodeURIComponent() method to encode a URI component
The encodeURI() method to encode a URI
The decodeURI() method to decode a URI
decodeURIComponent(
uri)
Parameter | Description |
uri | Required. The URI to be decoded. |
Type | Description |
A string | The decoded URI. |
decodeURIComponent()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!