i have been playing with Backbone, I am trying to learn how it works so I can create phonegap app using backbone. With version 0.9.9 all worked well, after upgrade to 0.9.10 it returns:
TypeError: collection[method] is not a function
collection[method](resp, options);
backbone-0.9.10.js (line 821)
It seems that problem has something to do with following sections:
var params = _.extend({
'method': 'GET',
'url': this.url,
'cache': true,
'dataType': 'json',
'processData': true
}, options);
console.log(params);
return $.ajax(params);
I am unable to find out what is wrong.
Working version with 0.9.9
http://92.245.6.92/backbone.peoples/index.html
Upgraded and not working version with 0.9.10
http://92.245.6.92/backbone.peoples/index2.html
Could you please help me whether there is major fault in my code or what happened. 0.9.10 is release candidate for 1.0 so I expect this not to work with any new version.
Thanks.
The fetch
successcallback signatures was changed from0.9.9to0.9.10. The callback signature is nowIn your app you’ve overridden
Collection.sync, and you execute the callback with (app.js:35):This leads to a situation where Backbone tries to call a method
reseton thedataobject, which is a vanilla javascript array and doesn’t have such a method.To comply to the new API, you need to call it with: