백본과 핸들이있는 페이지에서 두 모델을 렌더링 중입니다. 두 모델을 함께 연결하려고하는데 concat()
함수는 error:Undefined is not a function
을 반환합니다.정의되지 않음은 concat이있는 함수가 아닙니다.
이 내 렌더링 기능입니다 : 분명히 전송을 위해, JSON의 문자열 표현을 반환 this.collection.models[0].toJSON()
원래의 게시물에 몇 가지 의견에서
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;
},
트위터에있는 데이터가 있습니까? – Pete
네, 그렇습니다 .... –
줄이 뭐니? 문제가있을 경우 ** line number와 함께 ** 오류를 게시하고 관련 라인을 표시하십시오! 'console.log (typeof (twitter), twitter);를 시도해보십시오. –