我正在使用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);
导致这种情况的原因是什么?