我有一个提取的Twitter提要(.json文件),里面有一些推文,我只是想显示它,但由于某种原因我的代码不起作用。任何人都可以帮助我吗?
JSFiddle:http://jsfiddle.net/tsokekLw/
代码:
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$.ajax({
url: 'https://dl.dropboxusercontent.com/u/9239655/kevynlebouille.json',
dataType: 'jsonp',
success: function(dataWeGotViaJsonp){
var text = '';
var len = dataWeGotViaJsonp.length;
for(var i=0;i<len;i++){
twitterEntry = dataWeGotViaJsonp[i];
text += '<p><img src = "' + twitterEntry.user.profile_image_url_https +'"/>' + twitterEntry['text'] + '</p>'
}
$('#twitterFeed').html(text);
}
});
})
</script>
</head>
<body>
<div id='twitterFeed'></div>
</body>
</html>