All-in-one location/hashchange history management library

前端 未结 7 558
礼貌的吻别
礼貌的吻别 2020-12-23 13:55

First of all, I know there\'s libraries that provide polyfills for location.pushState/popState (History.js, Hash.js, jQuery hashchange), so please

7条回答
  •  太阳男子
    2020-12-23 14:30

    The AjaxTCR Library seems to cover all bases and contains robust methods that I haven't seen before. It's released under a BSD License (Open Source Initiative).

    For example, here are five AjaxTCR.history(); methods:

    init(onStateChangeCallback, initState);

    addToHistory(id, data, title, url, options);

    getAll();

    getPosition();

    enableBackGuard(message, immediate);

    The above addToHistory(); has enough parameters to allow for deep hash-linking in websites.

    More eye-candy of .com.cookie(), .storage(), and .template() provides more than enough methods to handle any session data requirements.

    The well documented AjaxTCR API webpage has a plethora of information with downloadable doc's to boot!

    Status Update:
    That website also has an Examples Webpage Section including downloadable .zip files with ready to use Front End(Client) and Back End(Server) project files.

    Notably are the following ready-to-use examples:
    One-way Cookie
    HttpOnly Cookies
    History Stealing
    History Explorer

    There are quite a bit other examples that rounds out the process to use many of their API methods, making any small learning curve faster to complete.

提交回复
热议问题