function changeUrl(base, find, value) {
var offset = base.indexOf(find);
var index;
var rr = '';
if(offset < 0){
if(base.indexOf('?') < 0) {
base += '?';
}else{
base += '&';
}
base += find + '=' + value;
}else{
left = base.substr(0, offset);
right = base.substr(offset);
index = right.indexOf('&');
if(index >= 0){
rr = right.substr(index);
}
base = left + find + "=" + value + rr;
}
return base;
}
console.log(changeUrl('http://www.car.dev/?per_page=2&ano=3&dis=1', 'ano', 4));