【发布时间】:2015-01-01 09:53:43
【问题描述】:
我想在我的 HTML 页面而不是 console.log 中显示语句的结果
我是新手:)
这是JS:
$.ajax({
url: 'xml/articles.json',
dataType: 'json',
type: 'get',
cache: false,
success: function(data) {
$(data.builds).each(function(index, value){
console.log(value.number);
});
}
});
这是我的 HTML 页面:
<!DOCTYPE html>
<html>
<head>
<title> JSON RSS parser </title>
</head>
<body>
<div class="feed">
<ul> </ul>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="js/logic.js"></script>
</body>
</html>
我试过了,但没有用:
$('.feed ul').append(
$('<li />', {
text: number
})
);
});
},
有什么想法吗?
【问题讨论】:
标签: javascript jquery html json rss