I have a server where I keep my PHP scripts and images. At first I had a problem because AJAX requests returned nothing: turned out that cross-origin sharing needed to be set up in the .htaccess file.
However, when I'm trying to load an image via 'Load image from URL' it still gives me this:
(...) has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I'm confused. How would I add this header specifically to an image file?
yeah any help please?
Develop games in your browser. Powerful, performant & highly capable.
It depends on the server. In theory it's the same as you did for the AJAX requests. The images need to be sent with the Access-Control-Allow-Origin: * HTTP header as well.