[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent [Back]  [Original]

decodeURIComponent() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

decodeURIComponent()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its 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: true

console.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 2027 LanguageSpecification
# sec-decodeuricomponent-encodeduricomponent


Web Proxy Viewer  |  New URL  |  Original Page