JavaScript 中的 decodeURI() 函数

htmljavascriptprogramming scripts

decodeURI() 函数接受表示编码 URI 的字符串值,对其进行解码并返回结果字符串。

语法

其语法如下

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

示例

<html>
<head>
   <title>JavaScript 示例</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>

输出

http://www.qries.com/
http://www.tutorialspoint.com/

相关文章