小编Vic*_*les的帖子

使用JavaScript从AWS S3读取JSON

我具有指向 AWS S3存储桶的链接,该存储桶会自动下载所需的JSON。只是为了澄清一下,JSON不会显示在网页本身上。我想从当前链接中将数据加载到JavaScript中。我尝试使用下面的以下功能,但没有用。该URL来自AWS转录。

function httpGetAsync(theUrl, callback)
{
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
            callback(xmlHttp.responseText);
    }
    xmlHttp.open("GET", theUrl, true); // true for asynchronous
    xmlHttp.send(null);
}
Run Code Online (Sandbox Code Playgroud)

有谁知道如何从该URL获取JavaScript对象?

javascript json amazon-s3 amazon-web-services aws-transcribe

5
推荐指数
1
解决办法
2871
查看次数