我正在尝试访问feedzilla api。但是,当我这样做时,似乎没有来自Web服务的响应。出了什么问题?以下是我的代码。
<html>
<head>
</head>
<body>
<div id="status"></div>
<script>
document.getElementById("status").innerHTML = "processing...";
var hr = new XMLHttpRequest();
var url = "http://api.feedzilla.com/v1/cultures.xml";
hr.open("GET", url, true);
hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
hr.send();
document.getElementById("status").innerHTML = "sent...";
hr.onreadystatechange = function() {
if(hr.readyState == 4 && hr.status == 200) {
document.getElementById("status").innerHTML = "received...";
var return_data = hr.responseText;
document.getElementById("status").innerHTML = return_data;
}
}
</script>
</body>
</html>