I have a simple Backbone
model:
define(function(require) {
var Backbone = require('backbone');
var SessionModel = Backbone.Model.extend({
url: 'http://stormy-ravine-2549.herokuapp.com/login',
parse: function(data) {
debugger;
}
});
return SessionModel;
});
Here is my code where I am saving the model:
var sessionModel = new SessionModel();
sessionModel.set('username', $('#email').val());
sessionModel.set('password', $('#password').val());
sessionModel.save({
success: function() {
debugger;
},
error: function() {
debugger;
}
});
I get a 200
response from the server with a json
body of {"msg": "success"}
. I hit the parse
method in the model
, but neither one of my callback functions get hit. Also, I am running my Chrome
browser with CORS
disabled. Doesn't either the success
or error
callback have to be hit?