decodeURIComponent() | javascript urldecode
ThedecodeURIComponent()functiondecodesaUniformResourceIdentifier(URI)componentpreviouslycreatedbyencodeURIComponent()[1]orbyasimilarroutine.decodeURIComponent(encodedURI)Parameters[2]encodedURIAnencodedcomponentofaUniformResourceIdentifier.Returnvalue[3]AnewstringrepresentingthedecodedversionofthegivenencodedUniformResourceIdentifier(URI)component.Exceptions[4]URIError[5]ThrownifencodedURIcontainsa%notfollowedbytwohexadecimaldigits,oriftheescapesequencedoesnotencodeavalidUTF-8character.decod...
The decodeURIComponent() function decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent()[1] or by a similar routine.
decodeURIComponent(encodedURI) Parameters[2]encodedURIAn encoded component of a Uniform Resource Identifier.
Return value[3]A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component.
Exceptions[4]URIError[5]Thrown if encodedURI contains a % not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character.
decodeURIComponent() is a function property of the global object.
decodeURIComponent() uses the same decoding algorithm as described in decodeURI()[6]. It decodes all escape sequences, including those that are not created by encodeURIComponent[7], like -.!~*().
Decoding a Cyrillic URL component[8]decodeURIComponent("JavaScript_%D1%88%D0%B5%D0%BB%D0%BB%D1%8B"); Catching errors...