XMLHttpRequest cannot load

3 posts / 0 new
Last post
Grex
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.


MQBrianCoakley
I see the Access-Control
I see the Access-Control-Allow-Origin:* header when I hit http://open.mapquestapi.com. Are you not seeing it?

StudioZoetekauw
Same problem

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.