Skip to content

Instantly share code, notes, and snippets.

@yoko
Created January 19, 2009 08:34
Show Gist options
  • Save yoko/48909 to your computer and use it in GitHub Desktop.
Save yoko/48909 to your computer and use it in GitHub Desktop.
Deferred#parallelでリストの並びを変えずに出力
var uri = encodeURIComponent('http://github.com/');
Deferred
.parallel({
ldc : $.getJSON('http://api.clip.livedoor.com/json/comments?callback=?&link='+uri),
hatebu: $.getJSON('http://b.hatena.ne.jp/entry/json/?callback=?&url='+uri)
})
.next(function(data) {
$('<div><p>GitHub:</p><ul/></div>')
.find('ul')
.append('<li>'+data.ldc.total_clip_count+' users at livedoor Clip</li>')
.append('<li>'+data.hatebu.count+' users at Hatena Bookmark</li>')
.end()
.appendTo('body');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment