JavaScript decodeURI() Function | javascript urldecode
ExampleDecodeaURIafterencodingit:leturi="mytest.asp?name=ståle&car=saab";letencoded=encodeURI(uri);letdecoded=decodeURI(encoded);TryitYourself»[1]DefinitionandUsageThedecodeURI()methoddecodesaURI.SyntaxParametersParameterDescriptionuriRequired.TheURItodecode.ReturnValueTypeDescriptionAstringThedecodedURI.BrowserSupportdecodeURI()isanECMAScript1(ES1)feature.ES1(JavaScript1997)isfullysupportedinallbrowsers:ChromeEdgeFirefoxSafariOperaIEYesYesYesYesYesYesReferencesTryitYourself»(www.w3schoo...
ExampleDecode a URI after encoding it:
let uri = "my test.asp?name=ståle&car=saab";let encoded = encodeURI(uri);let decoded = decodeURI(encoded);
Try it Yourself »[1] Definition and UsageThe decodeURI() method decodes a URI.
Syntax Parameters Parameter Description uri Required.The URI to decode. Return Value Type Description A stringThe decoded URI. Browser SupportdecodeURI() 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 References Try it Yourself » (www.w3schools.com)