我对编码非常陌生,希望有人能帮助我。我有一些代码,我正在尝试学习此过程:
任何帮助,我们将不胜感激!
const XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
const awsURL = 'https://cors.io/?http://status.aws.amazon.com/data.json';
function Get(awsURL){
var request = new XMLHttpRequest();
request.open("GET", awsURL, false);
request.send(null);
return request.responseText;
}
var AWSJson = JSON.parse(Get(awsURL));
console.log("Archived Outages: "+AWSJson.service_name);
答案 0 :(得分:1)
给定地址中的返回值格式不正确。在浏览器中输入URL并检查输出!