私はjavascriptクラス内にこの関数を持っています:
this.checkSections = function(){
jQuery('#droppable #section').each( function() {
nextId = jQuery(this).next().attr('id');
if (nextId != 'small' && nextId != 'large'){
jQuery(this).remove();
this.sections --;
this.followArticles = 0;
}else{
articles = 0;
obj = jQuery(this).next();
while (nextId == 'small' || nextId == 'large'){
articles++;
obj = obj.next()
nextId = obj.attr('id');
//alert(nextId);
}
this.followArticles = articles;
alert(this.sections);
}
});
}
the alert(this.sections);
(最後の行) はundefined
、sections
が定義され使用されていますが、の出力を提供します。
何が問題なのですか?