使用javascript的decodeURIComponent函數解碼查詢字符串時,處理不了"+"javascript
var q = '' decodeURIComponent(q.replace(/\+/g, '%20'))
即在調用decodeURIComponent函數以前要先把+替換爲%20,這樣就沒有問題了java
摘自:http://outofmemory.cn/code-snippet/3585/fix-js-decodeURIComponent-plus-issue函數