标签

标签 ‘decodeURIComponent’ 的存档

escape, unescape, encodeURI, decodeURI, encodeURIComponent, decodeURIComponent 等方法的对比分析

2008年12月6日

escape 方法
返回一个可在所有计算机上读取的编码 String 对象。

function escape(charString : String) : String
参数
charString
必选。要编码的任何 String 对象或文本。
备注
escape 方法返回一个包含 charstring 内容的字符串值(Unicode 格式)。所有空格、标点、重音符号以及任何其他非 ASCII 字符都用 %xx 编码替换,其中 xx 等于表示该字符的十六进制数。例如,空格返回为“%20”。

字符值大于 255 的字符以 %uxxxx 格式存储。

注意 escape 方法不能用来对“统一资源标识符”(URI) 进行编码。对其编码应使用 encodeURI 和 encodeURIComponent 方法。
要求
版本 1

请参见
encodeURI 方法 | encodeURIComponent 方法 | String 对象 | unescape 方法

适用于:Global 对象

[ more 阅读全文 ]

Javascript , , , , ,