Answer the question
In order to leave comments, you need to log in
How to make old code work in new version of backbone.js?
var Start = Backbone.View.extend({
el: $("#start"), // DOM элемент widget'а
events: {
"click input:button": "check" // Обработчик клика на кнопке "Проверить"
},
check: function () {
if (this.el.find("input:text").val() == "test") // Проверка текста
controller.navigate("success", true); // переход на страницу success
else
controller.navigate("error", true); // переход на страницу error
}
});
var start = new Start();
Answer the question
In order to leave comments, you need to log in
this.el.find
should be this.$el.find
.
Plus, check that the element with id start exists on the page at the time the script is called.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question