Decode a URI after encoding it:
let uri = "my test.html?name=ståle&car=saab";
let encoded = encodeURI(uri);
let decoded = decodeURI(encoded);
Try it Yourself »
The decodeURI()
method decodes a URI.
Use the encodeURI() method to encode a URI
The encodeURIComponent() method to encode a URI
The decodeURIComponent() method to decode a URI
decodeURI(
uri)
Parameter | Description |
uri | Required. The URI to decode. |
Type | Description |
A string | The decoded URI. |
decodeURI()
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 |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!