Google Map Web Service working on local but not online
I have a problem with a Javascript request to the Google Map Api Web Service : if I have the HTML file on my computer it works, but it doesn't work online.
Here's the code :
url = 'http://maps.google.com/maps/api/geocode/json?address=Senador+Francisco+Quindimil+Y+Carabobo+Por+Carabobo,Ciudad+Autonoma+de+Buenos+Aires,Argentina&sensor=false';
$.get(url, function(data) {
$('#result').html(data);
alert('Load was performed.');
}, 'text');
开发者_JS百科This sample is just supposed to load the "data" in the "result" element. When it is offline, the "data" has text, but not when it is online.
Sample here : Online Web Service Test
Could one of you guys help ?
Thanks a lot !
You are experiencing the same origin policy. You'll need to setup a server-side proxy (HTTP handler) to hit up Google Maps out in the wild.
精彩评论