html <img src=…> works but JS Image loading cause CORS error
问题 I want to create picture editor in js+jquery. At the first step i ask user to give image url. But I come across problem when i try load image data inside JS (to generate base64 image uri). I get error in console: … has beeb blocked by CORS policy: Access-Control-Allow-Origin … . But I wonder why? If in html file i create for instance (image hotlink): <img src="https://static.pexels.com/photos/87293/pexels-photo-87293.jpeg" /> The browser load image without any CORS problems ! Here is my JS