我正在按主干网开发一个应用程序,但现在也出现了同样的错误:
Uncaught TypeError: Object function (){ parent.apply(this, arguments); } has no method 'match'
当我添加了调用时,这个错误就会出现:
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;
});在这里,签名人:
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;
});发布于 2014-11-06 06:56:01
问题就在这条线上
define(["jQuery", "underscore", "Backbone", "Handlebars", "models/person", "views/signupview", "text!templates/loginview.html"], function ($, _, Backbone, Handlebars, PersonModel, Signupview, template) {
//your code
});在回调函数中忽略了PersonModel参数
https://stackoverflow.com/questions/16287402
复制相似问题