我想在AJAX项目中使用SWFAddress。在网站上有一些例子,但任何教程。 您知道我在哪里可以找到在我的网站上实施SWFAddress的快速指南吗?
由于
答案 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”)。