history.js icon indicating copy to clipboard operation
history.js copied to clipboard

Is there a method or property to solve my problem?

Open 810349088 opened this issue 10 years ago • 0 comments

Hi, Dear author, I use your api in my project. when i click the next page button, it will send the same request two times.

  1. First i push a state when click the next page button; submitAsJson(data, url, function (result) { (function (window, undefined) { var History = window.History; if (History.enabled) { var stateData = {}; stateData.url = url; stateData.data = data; History.pushState(stateData, '', '/staff/staffoverview.do'); } })(window);

    $("#staffDiv").html(result);
    

    });

2.Second i registe the statechange event (function (window, undefined) { History.Adapter.bind(window, 'statechange', function () { var stateData = History.getState().data;

            submitAsJson(stateData.data, stateData.url, function (result) {
                $("#staffDiv").html(result);
            })
        });
    })(window);

810349088 avatar Dec 12 '14 05:12 810349088