decodeURI() function in JavaScript

HTMLJavascriptProgramming Scripts

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/
raja
Updated on 25-Jun-2020 13:04:20

Advertisements