2017-12-26 7 views
0

Warum, wenn ich hole verwenden, um die Daten von dem Server mit behinderter Antwort CORS-Header zu laden, I'v expectedly einen Fehler bekam:
Failed to load http://www.imgworlds.com/wp-content/uploads/2015/12/18-CONTACTUS-HEADER.jpg: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63343' 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.
Aber Bild von Tag img präsentiert Wie img-Tag bekommt Inhalt über cors Header

<script> 
 
    fetch('http://www.imgworlds.com/wp-content/uploads/2015/12/18-CONTACTUS-HEADER.jpg').then(console.log); 
 
</script> 
 
<img src="http://www.imgworlds.com/wp-content/uploads/2015/12/18-CONTACTUS-HEADER.jpg">

Antwort