【发布时间】:2016-07-17 11:52:27
【问题描述】:
我尝试fetch一个旧网站的网址,出现错误:
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'})
好的,它现在可以工作了……但我看不懂。 =\
那么,不透明响应的目的是什么?
【问题讨论】: