SWFAddress和AJAX

时间:2009-12-30 16:19:19

标签: ajax swfaddress

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

由于

1 个答案:

答案 0 :(得分: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”)。