var getQueryParams = exports.getQueryParams = function(){
var arr = location.search.split(/(\?|&)/);
var parmsObj = {};
for (var i = 0; i < arr.length; i++) {
if(arr[i].indexOf('=') != -1){
var keyValue = arr[i].match(/([^\=]*)\=(.*)/);
parmsObj[keyValue[1]] = decodeURIComponent(keyValue[2]);
}
};
return parmsObj;
}
网友评论