Allow Access-Control-Allow-Origin header using HTML5 fetch API
问题 I am using HTML5 fetch API. var request = new Request('https://davidwalsh.name/demo/arsenal.json'); fetch(request).then(function(response) { // Convert to JSON return response.json(); }).then(function(j) { // Yay, `j` is a JavaScript object console.log(JSON.stringify(j)); }).catch(function(error) { console.log('Request failed', error) }); I am able to use normal json but unable to fetch the data of above api url. It throws error: Fetch API cannot load https://davidwalsh.name/demo/arsenal.json