Skip to content

Instantly share code, notes, and snippets.

@Jacqopb
Created May 10, 2012 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jacqopb/2651448 to your computer and use it in GitHub Desktop.
Save Jacqopb/2651448 to your computer and use it in GitHub Desktop.
AJAX Twitter client built with jQuery
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var url='http://search.twitter.com/search.json?callback=?&q=';
var query;
$('#queryButton').click(function(){
$("#twitterResults").html('');
query=$("#queryString").val();
$.getJSON(url+query,function(jsonTwitter){
$.each(jsonTwitter.results,function(i,tweet){
$("#twitterResults").append('<p>'+ tweet.text +'</p>');
});
});
});
});
</script>
</head>
<body>
<input type="text" id="queryString">
<input type="button" id="queryButton" value="Search">
<div id="twitterResults"></div>
</body>
</html>
@Jacqopb
Copy link
Author

Jacqopb commented May 10, 2012

First example of Twitter client with jQuery and Ajax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment