87,989
社区成员
发帖
与我相关
我的任务
分享result = (typeof (result) === 'string' ? [result] : result).concat(arr[i].split('=')[1]);var getParam = function (key) {
var arr = window.location.search.slice(1).replace(/\+/g, ' ').split('&');
var result = undefined;
for (var i = 0; i < arr.length; i++) {
if (arr[i].split('=')[0] === key) {
if (!result) {
result = arr[i].split('=')[1];
} else {
result = [result].concat(arr[i].split('=')[1]);
}
}
}
return result;
}