function getQueryStringArgs() {
if(!location.search.length > 0) {
return {};
}
var args = {},
items = location.search.slice(1).split('&'),
name,
value;
items.forEach(function(item) {
arr = item.split('=');
name = decodeURIComponent(arr[0]);
value = decodeURIComponent(arr[1]);
if (name) {
args[name] = value;
}
});
return args;
}
网友评论