I am using backbone.js, and trying to fetch some json from twitter, but it doesn't work, the collection's length is 0. Here's the code.
var Tweet = Backbone.Model.extend(); var Tweets = Backbone.Collection.extend({ model: Tweet, url: 'http://api.twitter.com/1/favorites.json?screen_name=dhh', parse: function(response) { return response.results; } }); var tweets = new Tweets(); tweets.bind('reset', function(tweets) { alert(tweets.length); }); tweets.fetch();