![Avatar of Starquest321](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
Starquest321
asked on
Ajax , Google MAP API directions
This is related to Ajax , Google MAP API directions
http://maps.googleapis.com/maps/api/directions/json?origin=806%2BChurch%2BSt%2CMorrisville%2CNC%2CUSA&destination=RDU%2BAirport%2CNC%2CUSA&sensor=false
When i access above URL in browser getting Json Response.
But when i call from Ajax Response is coming as empty (and some times Reload the page to get source : ). What is the mistake in below cade.
Attaching the Code in Html file.
gmap-live.html
http://maps.googleapis.com/maps/api/directions/json?origin=806%2BChurch%2BSt%2CMorrisville%2CNC%2CUSA&destination=RDU%2BAirport%2CNC%2CUSA&sensor=false
When i access above URL in browser getting Json Response.
But when i call from Ajax Response is coming as empty (and some times Reload the page to get source : ). What is the mistake in below cade.
Attaching the Code in Html file.
gmap-live.html
![Avatar of Starquest321](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
ASKER
Hi
I am running this page in server only. in the attached doc, ajax request getting response to first request but empty value for second request
I am running this page in server only. in the attached doc, ajax request getting response to first request but empty value for second request
![Avatar of leakim971](https://filedb.experts-exchange.com/files/public/2019/6/6/9cb56b74-5e10-4233-8ac5-a5e3ff3b2822.jpeg)
so consider my answer only apply to the second request
![Avatar of Starquest321](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
ASKER
Hi leak
I am not getting your solution.
Is there anything wrong in coding .
I am not getting your solution.
Is there anything wrong in coding .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you need to use a server side proxy to capture the data for you and send it back to your page