public
Last active

async but not ajax cross-site

  • Download Gist
gistfile1.htm
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<html>
<head></head>
<body>
<ul id="tweets">
</ul>
<a href="#">reload tweets</a>
<script src="jquery-1.3.2.min.js"></script>
<script>
function updateTwitter(tweets) {
var uls = '';
$(tweets).each(function(i, el) {
uls += '<li>' + el.text + '</li>';
});
$('#tweets').html(uls);
}
$('a').click(function() {
$('body').append($('<script src="http://twitter.com/statuses/user_timeline/pvalencia.json?callback=updateTwitter&count=3" />'));
});
</script>
<script src="http://twitter.com/statuses/user_timeline/pvalencia.json?callback=updateTwitter&count=3"></script>
</body>
</html>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.