How to enable cross origin support for ajax requests from other domains?

Hello all,
i am trying to set up a test api on my subdomain, for exchange of some data, firstly i made a test script to test out if the api is working fine or not, so whenever i make an ajax request, it shows an error describing that " cross origin requests are not allowed on this domain". As i know my response script is fine, my requesting script is fine. so one thought that came in my mind that could be an problem with the infinityfree servers, maybe the servers are not configured for CORS (Cross Origin Resource Sharing), they doesn’t allow CORS, so i just want to confirm that if anybody else facing the same problem or is there any workaround to get it working, please let me know!

I think it does allow CORS, you just need to set the appropriate HTTP headers.

CORS is blocked by a security system, you can read more about it here: