Greasemonkeyでprototype.jsやscript.aculo.usが使えたら便利だろうな、と考えたことのある開発者は少なくないのではないでしょうか。ちょっとそんなアイデアを試してみたことのある方ならわかると思うのですが、Greasemonkeyでそういった外部JavaScriptライブラリは簡単には使えません。案外ハードルが高いです。 Googleで調べていたら、面白い解決方法が見つかったので紹介します。 Loading External JavaScript Libraries in Greasemonkey このブログで解説されているアプローチを用いれば、Greasemonkeyで外部JavaScriptライブラリが使えるようになります。 ポイントは、 外部ライブラリがロードされるまで待ち続ける制御構造 unsafeWindowを経由して外部ライブラリにアクセス といっ
naoyaさん のJemplateの記事に触発されて埋め込みjavascriptを実装してみました。 同様の実装として Ajax Pages があるのですが、よりシンプルに実装してみました。コードにして50行。 サンプルファイルダウンロード これは今作っているフレームワークの一部です。シンプルですがわりと使えるかと。 実際の動作はサンプルファイルを見ていただくとして lyase_view.jsの説明どおり 1/* 2 * using innerHTML 3 * ------------- 4 * //in HTML 5 * <textarea id="template" style="display:none"> 6 * The value of x is:< %= context.x%> 7 * </textarea> 8 * //code 9 * document.write(Lyas
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く