Skip to content

Instantly share code, notes, and snippets.

@brycelambert
Created November 5, 2013 22:31
Show Gist options
  • Save brycelambert/7327523 to your computer and use it in GitHub Desktop.
Save brycelambert/7327523 to your computer and use it in GitHub Desktop.
jquery-ajax-twitter
$(document).ready(function() {
$('#search-button').click(function(event){
event.preventDefault();
jquery_ajax_load($('#username-field').val() + '.json');
});
});
var list_tweets = function(parsed_tweets) {
$('#tweetlist').html("");
var i = 0; for(; i < parsed_tweets.length; i++) {
$('#tweetlist').append("<li>" + parsed_tweets[i] + "</li>");
};
};
var jquery_ajax_load = function(url) {
$.ajax({
dataType: "json",
url: url,
success: function(data) { list_tweets(data); };
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment