How to solve problems with CORS?

When you use:

loadImage ('urldeoutrohost.jpg', img => {
     image (img, 0.0);

It ends up giving CORS error if you are not using a CORS extension. I would like to know if there is any way to solve this ?, why didn’t I want to have people have to install this extension to run my program.

Here the program exemple:

1 Like

The best, easier & correct way to load images from sites w/ CORS disabled is simply manually get them and place them inside your code’s folder: :file_folder:

If you don’t mind have your loaded images tainted, you can use createImg() instead: :framed_picture:

As a last recourse, you may use some CORS proxy service in order to load assets as if they had CORS enabled. :smiling_imp:

1 Like

This is not what I am looking for as it is intended to show the information / images coming from the API.

I wish there was some command to allow you to display images without this problem … why always make it so difficult? - ’

I don’t think I can fix this problem since I don’t have access to the server from which the API is being used nor the kk code editor itself
Anyone who wants to see will have to install this same CORS extension.