0

我想在 AJAX 项目中使用 SWFAddress。在网站上有一些例子,但任何教程。您知道在哪里可以找到在我的网站上实施 SWFAddress 的快速指南吗?

谢谢

4

1 回答 1

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")。

于 2010-01-02T14:16:50.943 回答