xhr.onreadystatechange = function () {
if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
response = JSON.parse(xhr.responseText);
if (separator) {
console.log(response.param.split(separator)[position]);
}
else {
console.log(response.param);
}
name.innerHTML=response.name;
console.log('name -' +param + ' surname -' + surname)
};
};
index = (page - 1) * 4 + index