採用コード内に次の if ステートメントが必要ですが、そこにある場合は無効です。他の方法で同じことを行う方法はありますか?
var ele = new Element('li').adopt(
new Element('span.title', {text:row.title}),
new Element('span.subtitle').adopt(
// Need this to work, but its invalid where it is atm
if(row.subtitle = 1)
{
new Element('img', {src:'images/subTitle.png'})
}
),
new Element('span.bold', {text:row.bold}),
);
ele.iject(...