开发者

SWFAddress and AJAX

开发者 https://www.devze.com 2022-12-15 15:56 出处:网络
I\'d like to use SWFAddress in an AJAX project. On the web site there are some examples but any tutorial.

I'd like to use SWFAddress in an AJAX project. On the web site there are some examples but any tutorial. Do yo开发者_JAVA技巧u know where I can find a quick guide to implement SWFAddress on my web site?

Thanks


I haven't found any docs either, but i guess this is the easiest way to implement it:

1- Add this function in your 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- Add appropriate anchors on your links (a href="#one").

0

精彩评论

暂无评论...
验证码 换一张
取 消