jQuery - $.getJSON Twitter
This example shows how to get your tweets using $.getJSON and displaying them in a unordered list.
uses empty, fadeOut, fadeIn, getJSON, bind, each
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div id="input">
<span>Enter Twitter Username</span>
<input id="twitterUsername" type="text" value="@john_papa"/>
<button id="getTweets">Get Tweets</button>
</div>
<div id="output"></div>
JavaScript
$("#getTweets").bind("click", function() {
var twitterUsername = $("#twitterUsername").val();
var url = "https://twitter.com/status/user_timeline/" + twitterUsername + "?count=5&format=json&callback=?"
//var url = "http://twitter.com/status/user_timeline/" + twitterUsername + ".json?count=5&callback=?";
/*
.success(function() { alert("another chained success"); })
.error(function() { alert("chained error"); })
.complete(function() { alert("chained complete"); });
*/
.done(function() { alert("another chained success"); })
.fail(function() { alert("chained error"); })
.always(function() { alert("chained complete"); });
;
});