Если использовать XMLHttpRequest, то как я понял без ответа серва с хедером "Access-Control-Allow-Origin" никакого ответа я не получу. Как же тогда по другому?
var xhr = new XMLHttpRequest();
xhr.open('POST', 'Вписывается адрес серва', true);
xhr.setRequestHeader('Content-Type', 'text-plain');
// xhr.onload = function() {
// alert( this.responseText );
// }
// xhr.onerror = function() {
// alert( 'Ошибка ' + this.responseText );
// }
xhr.onreadystatechange = function () {
console.log(xhr.responseText);
}
xhr.send();