Backbone.js fetch callback

backbone.js, javascript

Solution

You're passing 2 separate arguments to `fetch`. Combine them into a single object with `data`, `success`, and `error` fields and it should work for you.

Problem

I'm using Backbone.js and using fetch with options, but it doesn't seem to get the error or success callbacks, however data is being returned. ``` this.user.fetch({data: {username : this.username.val(), check : 'true'}}, { error: function(model, response) { console.log(response); }, success: function(model, response) { console.log(response); } }); ``` This is what I have setup, am I missing something? It never hits error or success, but it does do the ajax request and it's returning data. Thank you!

Original source