sometimes, use aja().url('xxx.com').data({a: 1}).go();the request url will be 'xxx.com?&a=1', the query string start with ?&,it is not too bright, fix it with:
var appendQueryString = function appendQueryString(url, params) {
var key;
url = url || '';
if (params) {
var querystring = '';
if (typeof params === 'string') {
querystring = params;
} else if (typeof params === 'object') {
for (key in params) {
querystring += '&' + encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
}
}
if (querystring.indexOf('&') === 0) {
querystring = querystring.substr(1);
}
url += (url.indexOf('?') === -1 ? '?' : '&');
url += querystring;
}
return url;
};
sometimes, use aja().url('xxx.com').data({a: 1}).go();the request url will be 'xxx.com?&a=1', the query string start with ?&,it is not too bright, fix it with: