function getUrlParam(k) {
var regExp = new RegExp('([?]|&)' + k + '=([^&]*)(&|$)');
var result = window.location.href.match(regExp);
if (result) {
return decodeURIComponent(result[2]);
} else {
return null;
}
}
具体用法如下:
var officeid = getUrlParam("officeid");
alert(officeid);