Javascript 主干错误
我正在按主干开发一个应用程序,但现在出现了相同的错误:Javascript 主干错误,javascript,backbone.js,parse-platform,Javascript,Backbone.js,Parse Platform,我正在按主干开发一个应用程序,但现在出现了相同的错误: uncaughttypeerror:Object函数(){parent.apply(this,arguments);}没有方法“匹配” 当我添加call new Signupview时,此错误开始出现: define(["jQuery", "underscore", "Backbone", "Handlebars", "models/person", "views/signupview", "text!templates/loginview
uncaughttypeerror:Object函数(){parent.apply(this,arguments);}没有方法“匹配”
当我添加call new 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;
});
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;
});
这里是注册视图:
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;
});
问题出在这条线上
define(["jQuery", "underscore", "Backbone", "Handlebars", "models/person", "views/signupview", "text!templates/loginview.html"], function ($, _, Backbone, Handlebars, PersonModel, Signupview, template) {
//your code
});
如果您在回调函数中遗漏了PersonModel参数,那么错误显然不是由发布的代码引起的。请查找其行号,并向我们提供相关的code.handlebar.js line 366match=this.\u input.match(this.rules[rules[i]]);请帮帮我!!我快疯了!requires和回调参数的长度不匹配。你的第五个要求是模特/人