我在带有主干和把手的页面上呈现两个模型。我试图将两个模型连接在一起,但concat()
函数返回error:Undefined is not a function
。未定义不是带concat的函数
这是我的渲染功能:
render: function (eventName) {
var twitter=this.collection.models[0].toJSON();
var instagram=this.collection.models[1].toJSON();
var conc=twitter.concat(instagram); <--LINE ERROR
$(this.el).html(this.template(conc));
return this;
},
是否在twitter中有任何数据? – Pete
是的,它...... –
什么是行?如果您有麻烦,请使用**行号码发布错误**并标记相关行!尝试'console.log(typeof(twitter),twitter);' –