2009-11-04 5 views
4

jQuery 주소 플러그인을 사용하여 내 아약스 웹 사이트에 연결하고 싶습니다. 솔직히 말해서 설정하는 방법을 이해하는 데 어려움이 있습니다.jQuery - 깊은 연결 jQuery 주소 작동

심지어 예도 분명하지 않은 것처럼 보입니다.

아무에게도이 작업을 수행하는 방법에 대한 간단한 예제가 있습니까?

답변

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(); 

}); 
+0

어떻게하면 최신 jQuery 버전으로 작업하게 할 수 있습니까? – kwoxer

+1

잘 모르겠다. Twas 4 년 전 : ( – Trevor

+1

http://stackoverflow.com/questions/28495507/deep-linking-with-ajax-does-not-work-with-latest-jquery-address/28594019#28594019 해결책이지만 다운 그레이드와 나쁜 스타일 = / – kwoxer