Я пытаюсь получить ответ через URL, используя javascript, но readystate ab = nd status не получает 4 и 200 соответственно.Когда URL выбирается напрямую, он работает, но не через код.
!<DOCTYPE html>
<html>
<body>
<head>
<script>
var Http = new XMLHttpRequest();
document.write("1");
var url='http://10.64.10.222:5000/';
document.write("2");
Http.open("GET",url);
document.write("3");
Http.send();
document.write("4");
document.write(Http.readyState);
document.write(Http.status);
Http.onreadystatechange = function(){
if(Http.readyState == 4 && Http.status == 200 ){
document.write("6");
document.write(Http.responseText);
}
document.write("5");
}
</script>
</head>
</body>
</html>