let connection = new XMLHttpRequest();
connection.open('GET', `${ prefix }groups.getLongPollServer?group_id=202228658${ postfix }`);
connection.responseType = 'json';
connection.send();
const connection_timer = setTimeout(() => {
console.log('ERROR! Shit happened! Server connection timeout!');
}, 5000)
connection.onload = () => {
clearTimeout(connection_timer);
console.log(connection.status);
console.log(connection.response);
}
connection.onerror = () => {
console.log('ERROR! Shit happened! Bad server connection!');
}
Возвращается код 200, но connection.response = undefined. Почему так?