decodeURI() 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/

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 25-Jun-2020

57 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements