98
rated 0 times
[
104]
[
6]
/ answers: 1 / hits: 20990
/ 11 Years ago, fri, april 12, 2013, 12:00:00
I am trying to get the Backbone.ajax to return the collection collection. I need the Model in another part of the program.
I would like to make the data available on the same level as the ajax method.
Backbone.ajax({
dataType: jsonp,
url: https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=twitterapi&count=25,
data: ,
success: function(val){ val
var Model = Backbone.Model.extend({});
var Collection = Backbone.Collection.extend({
model:Model
});
collection = new Collection(val);
console.log(collection);
}
});
More From » json