2009-12-30 49 views
0

我想在AJAX項目中使用SWFAddress。在網站上有一些例子,但任何教程。 你知道我在哪裏可以找到一個快速指南來實現我的網站上的SWFAddress?SWFAddress和AJAX

感謝

回答

0

我還沒有發現任何文檔下去,但我想這是實現它的最簡單的方法:()

1添加此功能在您的document.ready

SWFAddress.onChange = function() { //on url change 
    try { 
     var thePath = SWFAddress.getPathNames(); //get&split url 
     if (thePath[0] == 'one') go('one'); //if url is #one do something 
     if (thePath[0] == 'two') go('two'); //if url is #two do something 
    } catch(e) {} 
} 

2-在鏈接上添加適當的錨(a href =「#one」)。