介绍一下编码解码函数对
1. escape /unescape 主要用于汉字编码,返回字符的unicode编码值, 对“+”不能编码




2. encodeURI / decodeURI 用于对url进行编码,但对特殊字符如+ ? # @ & 等不能编码

3, encodeURIComponent /decodeURIComponent 用于对url进行编码,可以对特殊字符进行编码

本文详细介绍了三种不同的URL编码解码方法:escape/unescape、encodeURI/decodeURI及encodeURIComponent/decodeURIComponent。其中escape/unescape主要用于汉字编码;encodeURI/decodeURI用于URL编码,但不编码特殊字符;而encodeURIComponent/decodeURIComponent则可以对所有特殊字符进行编码。
介绍一下编码解码函数对
1. escape /unescape 主要用于汉字编码,返回字符的unicode编码值, 对“+”不能编码




2. encodeURI / decodeURI 用于对url进行编码,但对特殊字符如+ ? # @ & 等不能编码

3, encodeURIComponent /decodeURIComponent 用于对url进行编码,可以对特殊字符进行编码

转载于:https://www.cnblogs.com/ruoshui-llj/p/5826321.html

被折叠的 条评论
为什么被折叠?