The encodeURI and decodeURI functions are intended to work with complete URIs; they
assume that any reserved characters in the URI are intended to have special meaning and so are not
encoded. The encodeURIComponent and decodeURIComponent functions are intended to work with the
individual component parts of a URI; they assume that any reserved characters represent text and so must be
encoded so that they are not interpreted as reserved characters when the component is part of a complete
URI.
比较清楚的解析了这两对函数的区别。
ECMA5.1中关于encodeURI,decodeURI 和encodeComponentURI,decodeComponentURI的区别
时间: 2024-10-13 22:06:44