Javascript decodeURIComponent() 函数

decodeURIComponent() — 对 encodeURIComponent 函数编码的 URI 进行解码

语法:
  1. decodeURIComponent( URIstring );
参数说明:

URIstring — 字符串,含有编码 URI 组件或其他要解码的文本。

返回值:

URIstring 的副本,其中的十六进制转义序列将被它们表示的字符替换。

示例:
  1. var s = "https://github.com/Graybobo",
  2. s = encodeURIComponent( s );
  3. console.log( s );
  4. console.log( decodeURIComponent( s ) );
结果:
  1. >>>
  2. https%3A%2F%2Fgithub.com%2FGraybobo
  3. https://github.com/Graybobo