私は Solr 4.3.0 を使用しており、インターフェイスに Ajax-Solr を実装しています。ただし、Ajax-Solr は状態を自動的に保存しません。ParameterStore と ParameterHashStore メソッドがありますが、レガシー ブラウザーでは機能しません。google-fu を使用したところ、次のものが見つかりましたが、意図したとおりに機能しません。
https://github.com/evolvingweb/ajax-solr/pull/23
...さらにいくつかのリソースを使用して、これを思いつきました:
<script>
var Manager;
(function ($) {
Manager.setStore(new AjaxSolr.ParameterHashStore());
Manager.store.exposed = [ 'fq', 'q', 'start' ];
Manager.init();
// Establish Variables
var History = window.History; // Note: We are using a capital H instead of a lower h
if ( !History.enabled ) {
// History.js is disabled for this browser.
// This is because we can optionally choose to support HTML4 browsers or not.
return false;
}
State = History.getState(),
// Bind to State Change
History.Adapter.bind(window,'statechange',function(){ // Note: We are using
statechange instead of popstate
// Log the State
var State = History.getState(); // Note: We are using History.getState() instead
of event.state
History.log('statechange:', State.data, State.title, State.url);
});
// Log Initial State
History.log('initial:', State.data, State.title, State.url);
})(jQuery);
</script>
しかし、うまくいきません。[進む] ボタンと [戻る] ボタンはすべてのブラウザーで壊れており、コンソールには何も記録されません。
何が不足していますか、それとも v4.3.0 は現在本質的に機能していないため、パッチが必要ですか?
どんな助けでも大歓迎です。ありがとうございました!