This page was translated from English by the community.Learn more and join the MDN Web Docs community.
decodeURIComponent()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
decodeURIComponent() 함수는encodeURIComponent 나 비슷한 방법으로 생성된 Uniform Resource Identifier(URI) 컴포넌트를 해독합니다.
In this article
시도해 보기
function containsEncodedComponents(x) { // ie ?,=,&,/ etc return decodeURI(x) !== decodeURIComponent(x);}console.log(containsEncodedComponents("%3Fx%3Dtest")); // ?x=test// Expected output: trueconsole.log(containsEncodedComponents("%D1%88%D0%B5%D0%BB%D0%BB%D1%8B")); // шеллы// Expected output: false구문
js
decodeURIComponent(encodedURI);매개변수
encodedURI암호화된 Uniform Resource Identifier(URI) 컴포넌트.
반환 값
이스케이프되지 않은 특정 글자들 중 새로운 문자열.
예외
잘못 사용되었을 경우URIError ( " malformed URI sequence ") 예외를 발생시킵니다.
설명
암호화된 URI 컴포넌트에서 각각의 이스케이프 시퀀스(확장 문자열)를 자신을 나타내는 문자로 바꿉니다.
예제
>키릴문자 URL 컴포넌트의 복호화
js
decodeURIComponent("JavaScript_%D1%88%D0%B5%D0%BB%D0%BB%D1%8B");// "JavaScript_шеллы"명세
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-decodeuricomponent-encodeduricomponent> |