0
我我developying通過骨幹網的應用程序,但現在出去了同樣的錯誤:錯誤骨幹
Uncaught TypeError: Object function(){ parent.apply(this, arguments); } has no method 'match'
此錯誤開始出來的時候我已經添加了調用新Signupview:
define(["jQuery", "underscore", "Backbone", "Handlebars", "models/person", "views/signupview", "text!templates/loginview.html"], function ($, _, Backbone, Handlebars, Signupview, template) {
var LoginView = Backbone.View.extend({
template: Handlebars.compile(template),
events: {
"click .sign_up": "signUp_manual"
},
initialize: function() {
this.render();
},
render: function() {
var html = this.template();
$('#pagina').html(this.$el.html(html)); //appendo ad el);
return this;
},
signUp_manual: function() {
console.log("signup");
new Signupview();
}
//inserire funzione per log-in
});
return LoginView;
});
而這裏Signupview:
define(["jQuery", "underscore", "Backbone", "Handlebars", "text!templates/signup.html"], function ($, _, Backbone, Handlebars, template) {
var Signupview = Backbone.View.extend({
template: Handlebars.compile(template),
events: {},
initialize: function() {
this.render();
},
render: function() {
var html = this.template();
$('#pagina').html(this.$el.html(html)); //appendo ad el);
return this;
}
});
return Signupview;
});
錯誤顯然不從發佈代碼幹PersonModel說法。請查看其行號,並向我們介紹相關的代碼。 – Bergi 2013-04-29 20:17:10
handlebars.js line 366 – 2013-04-29 20:25:45
match = this._input.match(this.rules [rules [i]]); – 2013-04-29 20:30:28