Link to home
Start Free TrialLog in
Avatar of Starquest321
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
Avatar of leakim971
leakim971
Flag of Guadeloupe image

you're not allowed to download the json data directly from your page
you need to use a server side proxy to capture the data for you and send it back to your page
Avatar of Starquest321
Starquest321

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
so consider my answer only apply to the second request
Hi leak

I am not getting your solution.

Is there anything wrong in coding .
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial