【发布时间】:2015-05-07 21:57:49
【问题描述】:
据此:
http://en.wikipedia.org/wiki/Query_string#URL_encoding
“+”是一个有效的 URL 编码标记。
如果是这样,为什么decodeURIComponent 或decodeURI 不能将“hello+world”解码为“hello world”?
如果“+”有效,那么 JavaScript 中肯定有一个可以将“hello+world”转换为“hello world”的内置函数?
【问题讨论】:
-
这里已经提供了解决方案和解释:stackoverflow.com/questions/12042592/…
标签: javascript url urlencode urldecode