Skip to content

Instantly share code, notes, and snippets.

@InFog
Created May 25, 2012 23:23
Show Gist options
  • Save InFog/2791158 to your computer and use it in GitHub Desktop.
Save InFog/2791158 to your computer and use it in GitHub Desktop.
Exemplo Ajax com Twitter
<html>
<head>
</head>
<body>
<h1>Tweets mencionando a Unimonte</h1>
<ul id="lista_tweets">
</ul>
</body>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$.ajax({
'url' : 'http://search.twitter.com/search.json?callback=?&q=InFog9',
'type' : 'GET',
'dataType' : 'json',
'success' : function (resultado) {
var lista = '';
$.each(resultado.results, function(item) {
lista += '<li>' + resultado.results[item].text + '</li>';
});
$('#lista_tweets').html(lista);
}
});
</script>
</html>
<!-- Trabalho para o dia 05/06 - O que é Ajax, História e Linguagens Backend -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment