문제

I'm using the z weatherfeed plugin.

It already pulls most of the data from yweather api but I need the latitude and longitude.

The plugin gets the data for each item element like this for example:

html += '<div class="weatherCountry">'+ feed.location.country +'</div>';

However, if I try this...

html += '<div class="latitude">' + feed.item.geo.lat + '</div>';
html += '<div class="longitude">' + feed.item.geo.long + '</div>';

...it doesn't get the data for these elements.

How should I go about accessing both the geo:lat and geo:long?

Here's a live example: http://jsbin.com/sibafeke/1/edit

도움이 되었습니까?

해결책

The data for geo:lat and geo:long can be accessed this way:

html += '<div class="latitude">' + feed.item.lat + '</div>';
html += '<div class="longitude">' + feed.item.long + '</div>';
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top