decodeURI 方法和decodeURIComponent 方法

2010-08-28 10:46:24来源:西部e网作者:

decodeURI 方法

返回一个已编码的统一资源标识符 (URI) 的非编码形式。

decodeURI(URIstring)

必要的 URIstring 参数代表一个已编码 URI 的值。

说明

使用 decodeURI 方法代替已经过时的 unescape 方法。

decodeURI 方法返回一个字符串值。

如果 URIString 无效,那么将产生一个 URIError。


decodeURIComponent 方法

返回统一资源标识符 (URI) 的一个已编码组件的非编码形式。

decodeURIComponent(encodedURIString)

必选的 encodedURIString 参数代表一个已编码的 URI 组件。

说明

URIComponent 是一个完整的 URI 的一部分。

如果 encodedURIString 无效,将产生一个 URIError。

关键词:javascript

赞助商链接: