I use a AJAX-Jquery post to calculate the time to get from A to B using Google API.
But i get the error "XMLHttpRequest cannot load https://maps.googleapis.com/maps/api. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."
I've read a lot of posts and tried several solutions. None of them worked.
-
with different variants of headers in my .php page
header("Access-Control-Allow-Origin", "*"); header('Access-Control-Allow-Credentials: true');
-
modifing my .htaccess file:
Header set Access-Control-Allow-Origin "*"
installing Chrome extension Allow-Control-Allow-Origin
The third choise allowed me to test my code but is not a real solution. Does anyone succeded to solve this?