/**
* 获取url传参
* @return 一个不会为空的对象,对象的属性为参数名,值为参数值
*/
function getUrlParam() {
var param = {};
var search = location.search;
if (!search) {
return param;
}
search = search.substring(1);
var params = search.split('&');
for (var i = 0; i < params.length; i++) {
if (!params[i]) {
continue;
}
var keyValue = params[i].split('=');
if (keyValue.length > 1) {
param[keyValue[0]] = keyValue[1];
}
}
return param;
}