【发布时间】:2015-07-24 19:36:17
【问题描述】:
我正在使用天气 api,在使用 $.each 函数显示多个结果广告时遇到问题...
有人可以告诉我是否做错了,,,, 脚本&html
<div id="fj"></div>
<script type="text/javascript">
$(document).ready(function () {
var teams;
$.getJSON("http://api.openweathermap.org/data/2.5/forecast/daily?lat=33.5689&lon=72.6378&cnt=10", function (dataDD) {
//do some thing with json or assign global variable to incoming json.
var tasks = $.parseJSON(dataDD.city);
alert(tasks);
//alert('empLoggedId');
$.each(tasks, function (key, value) {
$("#fj").append(data.weather.description);
});
});
});
</script>
任何形式的帮助或参考将不胜感激...感谢您的宝贵时间
【问题讨论】:
-
@PeterKA 感谢您的回复,我愿意将这多个数据加载到我从 api url 获得的 html 中
标签: javascript jquery json asp.net-web-api