0
我需要採用代碼中的以下if語句,但如果它在那裏則無效。有什麼辦法可以用其他方式做同樣的事情嗎?Mootools 1.3如何在「Inject」函數中獲取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(...
乾杯:P應「這是一個想法」 – Nicekiwi