
Я пытаюсь чтобы получить информацию из API openweathermap в мое приложение. Я пытался использовать ajax для получения данных, но они отображаются как неопределенные.
$(function(){
var $temp = $('#temperature');
var $humidity = $('#humidity')
temp = document.getElementById("temperature");
$.ajax({
type: 'GET',
url: 'http://api.openweathermap.org/data/2.5/weather?q={' +
markers["title"] + '}&APPID=' + APPID,
success: function(data){
console.log('success', data);
$temp.append(data.main.temp);
$humidity.append(data.main.humidity);
}
});
});
var contentString = ''+
''+
''+
'' + markers["title"] + ''+
''+
' '+ temp +' °C' +
''+ humidity +'%' +
'';`
Подробнее здесь: https://stackoverflow.com/questions/450 ... query-ajax
Мобильная версия