我想用Prototype的新元素函數構造一個表。當我用完整的內容更新thead時,我遇到了Firefox中的問題:所有元素和內容。 Firefox正在剝離標籤並僅顯示內容。Prototype Element.update多個對象
無論如何,我決定構造每一個th元素,然後使用Element.update()
函數將它附加到thead。但是我還沒有找到用這個函數追加多個對象的方法。
的th元素看起來像這樣:
var thead_amount = new Element('th', {
'id': 'amount'
}).update('amount');
這工作正常:
new Element('thead').update(thead_amount);
此輸出與上述相同的:
new Element('thead').update(thead_amount, thead_pdf, thead_tags, thead_date, thead_options);
此輸出[object HTMLTableCellElement][object HTMLTableCellElement][object HTMLTableCellElement][object HTMLTableCellElement][object HTMLTableCellElement]
new Element('thead').update(thead_amount + thead_pdf + thead_tags + thead_date + thead_options);
如何在Prototype的update()
函數中附加多個對象?
謝謝!
我也嘗試了innerHTML,但在Firefox中沒有改變!thead應該是這樣的: