var regExp = new RegExp('([?]|&)' + k + '=([^&]*)(&|$)');
var result = window.location.href.match(regExp);
if (result) {
return decodeURIComponent(result[2]);
} else {
return null;
}