Javascript 未捕获(承诺中)引用错误:未定义blob
js代码:Javascript 未捕获(承诺中)引用错误:未定义blob,javascript,api,promise,fetch,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(r
<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>
log('我正试图获取一个c#徽标')//
获取('download.png')
。然后(响应=>{
console.log(响应)
返回response.blob()
})。然后(响应=>{
console.log(响应)
document.getElementById('C#logo').src=URL.createObjectURL(blob)
})
错误消息:
未捕获(承诺中)引用错误:未定义blob
在fetch.html:18你还没有定义blob是什么:
URL.createObjectURL(blob)
你可能想要response
而不是response
如果你不介意我问,我应该把响应放在URL中的什么位置?而不是blob
@BILAL。好的,谢谢,我是个编程新手,请原谅我的错误