일부 jQuery 아약스 내에서 Google지도 API를 사용하려고했지만 json을 사용하고 있어도 크로스 도메인이기 때문에이 작업을 수행 할 수없는 것처럼 보입니까?Google지도 API - Ajax를 사용할 수 없습니까? 존슨과도?
왜 이런가요? 이 문제를 해결하려면 어떻게해야합니까?
$.ajax({
type: "GET",
url: 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=405+Lexington+Avenue+Manhattan+NY',
error: function(request, status) {
alert('fail');
},
success: function(data, textStatus, jqXHR) {
alert('success');
}
});
감사!
javascript API로 인해 도메인 간 호출이 가능합니다. –
@DutrowLLC, jsonp 같은 것 같아요 :) –
@DutrowLLC JS 버전은 여기에 설명되어있는 것 같습니다. http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding –