I am trying to get response from an api that is not in my domain.
$.ajax({
type: "GET",
url: "http://stage.developmentcheck.org/api/project_monitoring_detail",
data:{'project_id':'16'},
error: function (response) {
alert('Error: There was a problem processing your request, please refresh the browser and try again');
},
success: function (response) {
console.log(response);
}
});
So the error says
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://stage.developmentcheck.org/api/project_monitoring_detail?project_id=16. This can be fixed by moving the resource to the same domain or enabling CORS.
So far I have only used html but since I am using ajax to get data from api, please enlighten me where should i enable CORS and how?
I have tried adding
Header set Access-Control-Allow-Origin "*"
in httpd.conf but it did not work.