Why I am getting 'Access-Control-Allow-Origin' when I run locally???
I am making the following request
-
$.ajax({
type: "GET",
success: function(response) {
console.log(response);
},
error: function(xhr, error){
console.debug(xhr); console.debug(error);
}
})
and unexpectedly getting the following response.
- XMLHttpRequest cannot load http://localhost:8181/data/status. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 404.
I am able to get around this by wrapping the request in jsonp but not sure why this is the case. Hope someone can help?