タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

JavaScriptとprototype.jsに関するneoashのブックマーク (1)

  • prototype.js 1.6.0 の DOM Builder で hello world - Gemmaの日記

    new Element('button',{onclick:"alert('hello world')"}) とやれば、 <button onclick="alert('hello world')"></button> になる。と思ったらダメだった。 Firefoxは大丈夫ですが、IEで動きません。 内部でsetAttributeが使われていて、setAttribute(onclick,"alert('hello world')")となるからです。 IEではsetAttributeの第2引数には関数オブジェクトを渡す必要があります こう書けばIEで動きます。でも、Firefoxでは動きません。 new Element('button',{onclick:new Function("alert('hello world')")}); 結局、こう書くことになります。 var elt = new

    prototype.js 1.6.0 の DOM Builder で hello world - Gemmaの日記
    neoash
    neoash 2009/03/08
    DOM Builder の話
  • 1