もはや jQuery なしでは JavaScript が書けない状態なんだけど、Greasemonkey で使うためには一工夫必要だったのでメモしておく。 参考にしたところ http://d.hatena.ne.jp/ysano2005/20060127/1138382734 http://d.hatena.ne.jp/lurker/20060813/1155432961 方針 HTMLにscriptタグを埋め込まない。 ページ表示時に毎回ロードするのは手間なので、ローカルにスクリプトを保存する。 unsafeWindow.$じゃなくて、$だけで使えるようにする。 コード 実際のコードはこんな感じ。 loadJQueryを呼び出すところは任意のイベントで構わない。 (function() { const DEBUG = true; const KEY_JQUERY = "my_jquery
Overview This is a simple snippet that helps us load the jQuery power into our userscripts with Greasemonkey 0.7 or lower, newer versions may use @require. Updates 2010-04-24: The userscript checks if jQuery is already loaded in the page and uses it, otherwise loads it from Google's CDN. It's also using jQuery.noConflict(true). Thanks to everyone who sent me emails about this over this and last ye
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く