escape, encodeuri, encodeURIComponent 区别

这里有3对:
escape / unescape
encodeuri / decodeuri
encodeURIComponent / decodeURIComponent

  1. escapse/unescapse 已经被废弃,不要再用;
  2. encodeuri/decodeuri 一般用来编码整个url,过滤对url有意义的特殊字符;
  3. encodeURIComponent/decodeURIComponent 一般用来编码url 参数的数据,编码的内容作为数据而存在;

这个问答里面有个详细的编码字符表:https://stackoverflow.com/questions/14317861/difference-between-escape-encodeuri-encodeuricomponent

标签: none

仅有一条评论

  1. ten ten

    Incidentally I have been ordering and Cialis not for the first month.

添加新评论