I created a fork of jQuery History plugin on Github.
- http://github.com/tkyk/jquery-history-plugin (the latest source code)
- Issue Tracking System: http://github.com/tkyk/jquery-history-plugin/issues
- Test page: http://www.serpere.info/jquery-history-plugin/sample/
Though this is just a fork for now, Mikage Sawatari, the original author of this plugin, and I agreed that it could be the mainstream in the near future.
I’ve already done some major changes to the script structure:
- It no longer uses the Webkit-specific hack for updating the location object, because recent versions of Webkit can correctly update the object just like Firefix and IE8.
- Hashes are percent-encoded with encodeURIComponent before being put to location.hash. So you can use any characters such as `?’ in your hash.
- history.load does not execute the callback unless hash is changed.
- Updated API/code format. Thanks to Kevin Dalman.
It works on IE6, IE7, IE8, Firefox3, Safari4, Chrome4, and Chrome5.
If you have any problems or feature requests, please create a new issue in the ITS. And of course, you can create your own fork.
jQuery Historyプラグインは今後Githubで管理されることになりました。
- プロジェクトページ: http://github.com/tkyk/jquery-history-plugin (最新版のソースコード)
- バグトラッキングシステム: http://github.com/tkyk/jquery-history-plugin/issues
- 動作サンプル: http://www.serpere.info/jquery-history-plugin/sample/
Mikage Sawatariさんによる元々のバージョンに対し、次のような大きな変更が加えられています。
- Webkitで動かすためのハックは不要になったので取り除かれました。
- location.hash に代入する前に encodeURIComponent によるパーセントエンコーディングを行うようにしました。これによって ? を含むあらゆる文字を hash として保存できるようになりました。
- ハッシュが変更されていない場合はコールバックが実行されないようになりました。
- API/コーディングスタイルを変更しました。この変更はフォーラムのKevin Dalman氏の投稿に依ります。
IE6, IE7, IE8, Firefox3, Safari4, Chrome4, Chrome5で動作します。
Githubのバグトラッキングシステムに登録してください。もちろん自分でforkを作って修正していただいても構いません。