How to use decodeURI in JavaScript

This article describe about decodeURI() Function in JavaScript.
  • 2034

decodeURI() Function in JavaScript

It is used to decode a URL.

Note: For encode URL use encodeURL() function.

Syntax

decodeURI(uri)

 

Parameter Description
uri Required. URL to decoded

Example

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

    var uri = "default.aspx?name=ståle&car=raman";

    document.write(encodeURI(uri) + "<br />");

    document.write(decodeURI(uri));

</script>

</body>

</html>

 

Output

 

pic7.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.