Yesterday, Dan G. Switzer, II was giving me some really great jQuery tips. Among the things that we discussed was the ability to define ananonymous function and then callit immediately: This is not jQuery specific, but the benefits of doing this is that you cancreate a totally private memory space in which to execute youranonymous function. In this memory space, locally declared variables won'

THIS PLUGIN IS NO LONGER MAINTAINED! Please use other plugins like jQuery hashchange. jQuery History Plugin jQuery history plugin helps you to support back/forward buttons and bookmarks in yourjavascript applications. You can store the application state into URL hash and restore the state fromit. Supported Browsers Internet Explorer 6, 7, and 8+ Safari 4 and 5+GoogleChrome 4+ This plugin is bu

jQueryでは非DOMオブジェクトにもeventをbind/triggerできる Binding Events To Non-DOM Objects With jQuery この例だとwindow.location.hrefが変化しているかどうかTimerで監視し続け、 変化したタイミングで$( window.location ).trigger('change',data);で変更前後の情報を通知している。 なので、$( window.location ).bind('change',function(ev,data){});で通知を受け取る事ができる。 hashで状態を管理しているAjaxアプリで有効そうなテクニック。 select boxでcustom eventを活用 http://trulyevil.com/2009/05/07/custom-events-in-jquery/
2年ほど前に同じ事で悩んでドキュメントに残しておかなかったので、最近また同じ事で悩んでしまったので書いておこうと思います。まぁそもそも元の実装方法が悪いのが原因なのでアレなんだけど、ソレはソレで業務アプリ側を変更できない部分なので仕方がない・・・という余計な前置きはさておいて・・・ 例えば登録系の処理で入力ミスがある場合、フォーム箇所まで表示位置をスクロールさせた状態でページ遷移をさせたい要件を考えます。単純に考えて http://localhost/hoge.cgi#name1 のように form の action 先の location.hash をよろしく設定すると思います。 通常なら何も問題なく location.hash の値に従ってアンカー名が検索され表示位置が補正(移動)されてページ遷移しますが、ie でアクセスした場合に限り、location.hash に従ってブラウザのエ
今更ですが、location.hashで現在のステータスを管理するのがマイブームです。しかし、ASCII以外をぶち込むとブラウザごとに挙動が違うっぽいです。というのを調べておいて、書いておくのを忘れたので、まとめておきます。 方法 以下のアクションを起こした場合、location.hashで取得できる値がどうなるか、調べました。なお、ファイルはUTF-8で試しました。 ファイルに書いてあるリンクをクリックした場合 A1:#test B1:#てすと C1:#%E3%81%A6%E3%81%99%E3%81%A8 A2:#test#test B2:#てすと#てすと C2:#%E3%81%A6%E3%81%99%E3%81%A8#%E3%81%A6%E3%81%99%E3%81%A8 A3:#test%23test B3:#てすと%23てすと C3:#%E3%81%A6%E3%81%99%E3%
1リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く