encodeURIComponent()编码
var str = ' numresults:10 sort:publication-date direction:descending'
str = encodeURIComponent(str)
//%20numresults%3A10%20sort%3Apublication-date%20direction%3Adescending
decodeURIComponent()解码
var str = '%20numresults%3A10%20sort%3Apublication-date%20direction%3Adescending'
str = decodeURIComponent(str)
// numresults:10 sort:publication-date direction:descending
博客介绍了encodeURIComponent()编码和解码函数decodeURIComponent(),这两个函数在信息技术领域常用于处理URL编码和解码,能有效避免特殊字符在传输过程中出现问题。

4006

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



