I'm learning to work with Backbone.js and set up the following environment:
/* define the model */
var Login = Backbone.Model.extend({
url:"api/index.php/login/"
});
/* the following code is contained in a view method */
var login = new Login({
email: $("#email").val(),
pass: $("#pass").val()
});
var result = Backbone.sync('create',login);
alert(JSON.stringify(result));
In the "index.php" on the server the correct method is called and the data is correctly available.
The alert just outputs: {"readyState":1}
Now my question: What should the server (index.php) return/output to answer the client? I'd like to transfer data back to the client to e.g. display it.