I've been tasked with making a twitter public timeline feed and I've been having some issues with the scripts I've been using. For a moment, I thought maybe my jquery was not invoking from within my wamp setup but I added a js "Hello World" statement in my jquery-1.4.4.1.1js and sure enough it rendered to the page.
So then with the following inline script:
I don't understand why I am not passing the json array and being able to put it in a series of list items.PHP Code:<script type='text/javascript'>
document.write('<b>Hello World</b>');
$(function() {
var html = "<ul>";
var tweeturl = "http://api.twitter.com/version/statuses/public_timeline.json?count=10&callback=?";
$.getJSON(tweeturl, function(d) {
$.each(d, function(i, item) {
html += "<li>" + item.text + "</li>";
});
html += "</ul>";
$('#twitter-feed').append(html);
});
});
</script>
Can anybody help me with this?


Reply With Quote

Bookmarks