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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With