4

jQuery アドレス プラグインを使用して ajax Web サイトをディープ リンクしたいのですが、正直なところ、設定方法を理解するのに苦労しています。

例でさえ明確ではないようです。

これを機能させる方法の簡単な例はありますか?

4

1 に答える 1

7

私もこれを初めて経験しました。ドキュメントは貧弱ですが、非常に優れたプラグインです。

$.address.init(function(event) {

}).change(function(event) {
     // all your application work should be within here.
     // each time something changes this will run
     // use the api methods to find out what is going on.
     event.path // returns the current full path from beyond /#/
     event.queryString // returns the query string ex: /#/?page=1
     event.value // returns the value /#/Home
     // These can all be accessed globally by using $.address.path(), etc         

     // usage
     // example of clicking an a tag set with the ref or href set as a div id
     // be sure to set that in the init method above
     // Shows the selected div
     $('#'+event.value).show();

});
于 2011-03-12T16:35:18.553 に答える