网上随便找的一个
function getUrlParam(k) {
var regExp = new RegExp('([?]|&)' + k + '=([^&]*)(&|$)');
var result = window.location.href.match(regExp);
if (result) {
return decodeURIComponent(result[2]);
} else {
return null;
}
}