Я могу выполнять запросы Http (POST / GET) с помощью XMLHttpRequest.
Я спрашиваю, как выполнять запросы с URL-адресами типа https://www.gmail.com. Я пробовал что-то подобное, но код состояния 0
var http = new XMLHttpRequest();
var url = "https://www.gmail.com";
http.open("GET", url);
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
//alert(http.responseText);
print("ok")
}else{
print("cannot connect")
print("code:" + http.status)
print(http.responseText)
}
}
http.send(null);
Я всегда получаю «не могу подключиться», «код» 0 и ничего в ответе
Есть идеи?