jsexecutor クラス : SetJS(string,string)メソッド
説明
script タグを作成し、JavaScript コードを挿入します。
構文
instance.SetJS(string jscode, string id)
引数
| クラス | 名前 | 説明 |
| string | jscode | JavaScript コード。 |
| string | id | id 属性。 |
返り値
無し。
サンプルコード
| 1: | jsexecutor jse; // For Main-browser |
| 2: | jse.SetJS("function hello(){alert('hello world!');}", "smple"); // It creates a script tag has JS code and id. |
以下の様な script タグが body タグに追加されます。
| 1: | <script id="sample"> |
| 2: | function hello(){alert('hello world!');} |
| 3: | </script> |
注意
第一引数に空文字列を指定すると例外(RtypeException)が発生します。
参照リンク
無し。


