encodeURIComponent(v))编码的时候如果v==null的话,编码成了字符串null
Open
- Dominant language
- JavaScript
- Stars
- 13.5k
- Forks
- 6.5k
- PR merge metrics
- No merged PRs in 30d
Description
encodeURIComponent(v))编码的时候如果v==null的话,编码成了字符串null
官网源码:
$.param = function(obj, traditional) {
var params = [];
params.add = function(k, v) {
this.push(encodeURIComponent(k) + '=' + encodeURIComponent(v));
};
serialize(params, obj, traditional);
return params.join('&').replace(/%20/g, '+');
};
建议修改
this.push(encodeURIComponent(k) + '=' + (v == null ? "" : encodeURIComponent(v)));
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.