Thu, 06/25/2015 - 03:09
#1
XMLHttpRequest cannot load
Hi,
having troubles to get respond from mapquest api from my internal server :(
My code:
url = "http://open.mapquestapi.com/directions/v2/optimizedroute?key={{api_keys.mapquest}}&routeType=shortest";
$.getJSON(url, {
locations: locations
})
.done(function(data) {
console.log(data);
});
But I get always in chrome:
XMLHttpRequest cannot load http://open.mapquestapi.com/directions/v2/optimizedroute?key=...... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://myserverinlocalnetwork' is therefore not allowed access.
Hello,
I have the same problem in both Chrome as Firefox.
"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access."
How can we fix this? This is only a problem when doing a post.
Regards,
Berend.