Created
May 25, 2012 23:23
-
-
Save InFog/2791158 to your computer and use it in GitHub Desktop.
Exemplo Ajax com Twitter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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