昨日のサンプルコードを書くときに気になってちょっと試していたのだけど、innerHTMLでscriptタグを挿入しても実行されないみたいだなー。(FireFox3とIE7では)。あれ、じゃYUIのGetUtilityはどうやってるんだろう、と思っていろいろ試してみるとappendChild()を使ってhead要素に追加するとスクリプトが実行されるようだ(FireFox3、IE7とも)。さらに、FireFox3ではhead要素以外の適当なdivにappendChild()してもスクリプトが実行される。 操作 IE7 FireFox3 innerHTMLでscriptタグを挿入 実行されない 実行されない innerHTMLでsrc属性を持つscriptタグを挿入 実行されない 実行されない appendChildでscriptタグをheadに挿入 実行される 実行される appendChil