encodeURI / decodeURI 编解码URI
进行url跳转时可以整体使用encodeURI
encodeURIComponent / decodeURIComponent 编解码URI组件
传递参数时需要使用encodeURIComponent
escape / unescape 对字符串进行unicode编码
escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z
encodeURI不编码字符有82个:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z
encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,_,~,0-9,a-z,A-Z
进行url跳转时可以整体使用encodeURI
encodeURIComponent / decodeURIComponent 编解码URI组件
传递参数时需要使用encodeURIComponent
escape / unescape 对字符串进行unicode编码
escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z
encodeURI不编码字符有82个:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z
encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,_,~,0-9,a-z,A-Z