📜  获取 api javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:03.928000             🧑  作者: Mango

代码示例6
fetch('https://picsum.photos/600/300')
    .then(res => res.blob())
    .then(blob => {
        let img = document.createElement('img');
        console.log(img);
        img.src = URL.createObjectURL(blob);
        document.body.appendChild(img)
        docuemnt.querySelector('body').appendChild(img);
    });