1. When there are spaces in the parameter, the spaces in the value obtained are replaced with plus signs:
2. When the value of a certain key in the parameter does not exist, the value obtained is not empty/null but true.
I found a solution online, you can refer to it (whether there are other side effects have not yet been tested)
1. Change spaces into plus signs
in jQuery.query. js file, find the following code
toString: function() {
var i = 0, queryString = [], chunks = [], self = this;
var encode = function(str) {
str = str "";
//if ($ spaces) str = str.replace(/ /g, " ");
return encodeURIComponent(str);
};
Comment out if ($spaces) str = str.replace(/ /g, " "); That line can be
2. When the value is empty
get: function (key)
{
var target = this.GET(key);
if (typeof (target) == 'boolean')
return '';
if (is(target, Object))
return jQuery.extend(true, {}, target);
else if (is(target) , Array))
return target.slice(0);
return target;
},
Join if (typeof (target) == 'boolean')return ' ';
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn