https://jsfiddle.net/chcvc72h/var link = document.querySelector('a');
link.addEventListener('click', getParam);
function getParam(e){
e.preventDefault();
let vSearch = getURLParam(e.target.search, 'search'),
vType = getURLParam(e.target.search, 'type'),
vPagen = getURLParam(e.target.search, 'PAGEN_1'); // тут вводим имя параметра
console.log(vSearch, vType, vPagen); // text xxx 2
}
function getURLParam(target, name) {
return decodeURI(target.replace(new RegExp("^(?:.*[&\\?]" + encodeURI(name).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
}