var LoginView = SerializableView.extend({ el: "#login", events: { "click .newuser": "newuser", "submit form": "save", }, initialize: function(){ this.$form = this.$("form") this.$msg = this.$(".msg") }, show: function(){ app.footer.show("SUBMIT", "CANCEL") this.$form.get(0).reset() this.$msg.html("* Your personal and payment information will always remain private") document.body.className = "login" }, newuser: function(){ app.router.go("account/signup") }, save: function(e){ e && e.preventDefault() var data = this.serialize() sdk.account.login({ data: data }).done(function(data){ console.log("LOGIN SUCCESS", data) }).fail(function(data){ console.log("LOGIN FAIL", data) }) }, })