close

[Solved] XMLHttpRequest blocked by CORS Policy

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error XMLHttpRequest blocked by CORS Policy in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How XMLHttpRequest blocked by CORS Policy Error Occurs?

Today I get the following error XMLHttpRequest blocked by CORS Policy in javascript.

How To Solve XMLHttpRequest blocked by CORS Policy Error ?

  1. How To Solve XMLHttpRequest blocked by CORS Policy Error ?

    To Solve XMLHttpRequest blocked by CORS Policy Error I know this might be late, but hope this will help others. This problem comes from backend side, call CORS. I'm using java for backend so I added@CrossOrigin to Controller class. It works!

  2. XMLHttpRequest blocked by CORS Policy

    To Solve XMLHttpRequest blocked by CORS Policy Error I know this might be late, but hope this will help others. This problem comes from backend side, call CORS. I'm using java for backend so I added@CrossOrigin to Controller class. It works!

Solution 1

I believe sideshowbarker ‘s answer here has all the info you need to fix this. If your problem is just No ‘Access-Control-Allow-Origin’ header is present on the response you’re getting, you can set up a CORS proxy to get around this. Way more info on it in the linked answer

Solution 2

I know this might be late, but hope this will help others. This problem comes from backend side, call CORS. I’m using java for backend so I added@CrossOrigin to Controller class. It works!

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment