I'm working on a project with Backbonejs (1.0.0) and I'm trying to fetch a model. Well, correct me if I'm wrong, but fetching a model means getting data from server and update model attributes. So, what I did:
The model:
var Lead = Backbone.Model.extend({
idAttribute : "project_id",
defaults: {
ws_qs : 'toto'
}
});
The action:
/* this.model comes from a collection, which has been fetched earlier.
So this.model contains correct data. I just want to refresh from the server. */
var tmpModel = this.model;
this.model.set({ws_qs : "youpi"}, {silent:true});
this.model.fetch({
success : function (model) {
// do something
}
});
Fetch generates an XHR call with a correct url.
Some idea: in Chrome debuger, the XHR call response is empty, but opening xhr call url in a browser display correct JSON.
6 hours spending on that bug... anyone could help me? Thanks.