以下のようなものを使用する場合new Element()
、エフェクトが必要でない限り、scriptaculousライブラリをロードする必要はありません-これらはコードPrototypeJSフレームワークに組み込まれています。
これ
Builder.node('td',{'colspan':'12','class':'bdr-bottom'},(noteText))
に変更することができます
new Element('td',{'colspan':12,'class':'bdr-bottom'}).update(noteText);
これ
for (var i=1; i<numCols; i++)
{
noteRowSpan=Builder.node('td',{'class':'bdr-bottom'},(''));
$(noteRow2).insert($(noteRowSpan));
}
これに変更することができます
for(var i=1 ; i<numCols; i++)
{
noteRowSpan = new Element('td',{'class':'bdr-bottom'});
$(noteRow2).insert(noteRowSpan);
//if noteRow2 is created with new Element() you don't need to re-extend it do it like this
noteRow2.insert(noteRowSpan);
}
フォローアップのために編集
メソッドのパラメーターはnew Element()
子要素ではなく、作成する要素の属性です。
あなたがしたいことのために
noteRow1= new Element('tr',
new Element('td',{'class': 'bld rt'},'Date:'),
new Element('td').update(noteText)
);
このように行う必要があります
noteRow1= new Element('tr');
noteRow1.insert(new Element('td',{'class': 'bld rt'}.update('Date:'));
noteRow1.insert(new Element('td').update(noteText));
または一緒にチェーン
noteRow1= new Element('tr').insert(new Element('td',{'class': 'bld rt'}).update('Date:')).insert(new Element('td').update(noteText));
また、ガイドラインのメモとして-コメントリンクをクリックしてフォローアップの質問をすることができます