Decode URI Function in JavaScript



The decodeURI() function accepts a string value representing an encoded URI, decodesit and, returns the resultant string.

Syntax

Its Syntax is as follows

decodeURI('http://www.qries.com/');

Example

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result1 = decodeURI('http://www.qries.com/');
      document.write(result1);
      document.write("<br>");
      var result2 = decodeURI('http://www.tutorialspoint.com/');
      document.write(result2);
   </script>
</body>
</html>

Output

http://www.qries.com/
http://www.tutorialspoint.com/
Updated on: 2020-06-25T13:04:20+05:30

86 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements