removed utils.getQueryParams() use utils.params()

This commit is contained in:
Barış Soner Uşaklı
2015-02-19 16:11:23 -05:00
parent 743cd20441
commit c3a51033a8
3 changed files with 7 additions and 22 deletions

View File

@@ -270,9 +270,12 @@
value = options.skipToType[key] ? decodeURI(val[1]) : utils.toType(decodeURI(val[1]));
if (key) {
if (key.substr(-2, 2) === '[]') {
key = key.slice(0, -2);
}
if (!hash[key]) {
hash[key] = value;
} else {
} else {
if (!$.isArray(hash[key])) {
hash[key] = [hash[key]];
}
@@ -293,24 +296,6 @@
return a;
},
getQueryParams: function() {
var search = window.location.search.slice(1),
data = {};
search = search.split('&');
for(var x=0,numParams=search.length,temp;x<numParams;x++) {
temp = search[x].split('=');
if (temp[0].substr(-2, 2) !== '[]') {
data[temp[0]] = temp[1];
} else {
data[temp[0].slice(0, -2)] = data[temp[0].slice(0, -2)] || [];
data[temp[0].slice(0, -2)].push(temp[1]);
}
}
return data;
},
// return boolean if string 'true' or string 'false', or if a parsable string which is a number
// also supports JSON object and/or arrays parsing
toType: function(str) {