我尝试fetch
了一个旧网站的URL,并且发生了错误:
Fetch API cannot load http://xyz.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://abc' is therefore not allowed access.
If an opaque response serves your needs, set the request's mode to 'no-cors'
to fetch the resource with CORS disabled.
我理解了该消息,并尝试执行一个返回不透明响应的请求:
fetch("http://xyz", {'mode': 'no-cors'})
好的,它现在可以工作了......但我无法阅读它。=\
那么,不透明响应的目的是什么?