Uncaught (in promise) ReferenceError: blob is not defined

时间:2021-04-06 10:27:18

标签: javascript api promise fetch

js 代码:

    <script>
            console.log('im trying to fetch a c# logo')//
            fetch('download.png')
            .then(response => {
                console.log(response)
                return response.blob()
            }).then(response =>{
                console.log(response)
                document.getElementById('C# logo'). src = URL.createObjectURL(blob)
            })
        </script>

错误信息: Uncaught (in promise) ReferenceError: blob is not defined 在 fetch.html:18

0 个答案:

没有答案