Я пытаюсь запросить все места в центре Лондона в радиусе 1000 метров, используя Google Places API , требуемый тип вывода - XML.Это мой код с использованием JQuery:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
</head>
<body>
<script>
jQuery(document).ready(function(){
jQuery.ajax({
url: 'https://maps.googleapis.com/maps/api/place/search/xml',
dataType: 'xml',
type: 'GET',
data: {
key: 'MY KEY',
location: '51.526688,-0.123825',
radius: 1000,
sensor: 'false',
types: 'food'
},
success: function(data){
alert("success");
},
error: function(data){
alert("error");
}
});
});
</script>
</body>
</html>
К сожалению, я получаю только сообщение error
.Консоль Firebug показывает мне XML Parsing Error: no element found Location: moz-nullprincipal:{7577ff8b-21cb-40c5-824b-de812540f29e} Line Number 1, Column 1:
.Я получил свой собственный ключ API и включил Places API
.(URL-адрес веб-сайта "http://localhost/",, так как я пишу локально, используя XAMPP.)