Ajax code error citing block by CORS policy

my ajax code isn’t working.Says access to XMLhttprequest blocked by CORS policy.
above is a screenshot of the same.

Did you check on StackOverflow regarding this question? Or maybe check this link:

thank you,
i’ll look into it.

Hello @adeeshdesai
Can you please share a screenshot of the code ?

here is the code.

Awesome !
I think you just need to replace ‘s’ by ‘S’ in readystate on line 19 and check it out.

Here is mine. You can check it. Also, let me know if it works.

I just noticed the semicolon after https at line 15. Please replace the semicolon with a colon.

it should be like this : https://reqres.in/api/users/

1 Like

yes,i noticed it too.correcting it.Thank you.

1 Like

apparently that was the error.
Thanks again.


You are most welcome !!!
I suggest you to double check punctuations and case sensitivity anytime you write a program.
It will help.

1 Like