为什么history.getState()。data为空?

时间:2015-12-07 20:17:08

标签: javascript history.js html5-history

我正在使用historyjs来管理对HTML5 API的访问,而我遇到了弹出状态数据为空白的问题:

    // Bind to State Change
    history.Adapter.bind(window, 'statechange', function ()
    { 
        if (!self.navigateEnabled)
            return;

        //get the state
        var state = history.getState();

        //use state data here, but it's empty....
    });

这是在AJAX页面上,当用户从select元素中选择时,我推送的状态肯定是具有各种属性的有效对象:

history.pushState(this.data, "", url);

导致这种情况的原因是什么?

0 个答案:

没有答案