Autumn_Ning_Blog icon indicating copy to clipboard operation
Autumn_Ning_Blog copied to clipboard

encodeURIComponent、encodeURI、escape

Open wangning0 opened this issue 8 years ago • 0 comments
trafficstars

  • encodeURIComponent 需要传递参数时,需要用encodeURIComponent进行包裹,这样特殊参数不会被截断
  • encodeURI 进行url跳转的时候可以用encodeURI进行包裹
  • escape 用的较少,一般对数据就行处理
escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z

encodeURI不编码字符有82个:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z

encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,_,~,0-9,a-z,A-Z

wangning0 avatar Jul 24 '17 07:07 wangning0