javascript - How to get data using fetch API with mode 'no-cors'? -
code looks this, not sure how read response data. idea?.
var url = 'http://www.bbc.co.uk/sport/football'; fetch(url, { mode : 'no-cors' }).then(function(response) { console.log(response); });
you can't.
if origin doesn't support cors, can't response data directly. that's whole point of no-cors
... allowing use response in ways, not read/access data.
Comments
Post a Comment