Why do i get and how to fix this cors error?

here's a screenshot on a CORS error that i'm getting (It includes both the code & the error). Is there anyone who can help me out with this ? Imgur link