function getParam(path, name) {
var reg = new RegExp("(\\?|&)" + name + "=([^&;#]*)(\\s|&|$|#)", "i");
if (reg.test(path)) {
return unescape(RegExp.$2.replace(/\+/g, " "));
}
return '';
},
或者
function getParam(name) {
return location.href.match(new RegExp('[?#&]' + name + '=([^?#&]+)', 'i')) ? RegExp.$1 : '';
}