How to keep the browser history in sync when using Ajax?

后端 未结 8 1770
無奈伤痛
無奈伤痛 2020-11-29 07:48

I\'m writing a simple photo album app using ASP.NET Ajax.
The app uses async Ajax calls to pre-load the next photo in the album, without changing the URL in the browser.

8条回答
  •  死守一世寂寞
    2020-11-29 08:16

    You can use simple & lightweight PathJS lib.

    Usage example:

    Path.map("#/page1").to(function(){
        ...
    });
    
    Path.map("#/page2").to(function(){
        ...
    });
    
    Path.root("#/mainpage");
    Path.listen();
    

提交回复
热议问题