stateObj是传递给history.pushState的,它是做什么的?
例如,history.pushState(stateObj,title,url);
解决方法
状态对象,as defined by the spec,是您,作者想要与该状态相关联的任何对象:
Pages can add state objects between their entry in the session history and the next (“forward”) entry. These are then returned to the script when the user (or script) goes back in the history
MDN具有更实用(特定于Firefox的)定义:
The state object can be anything that you can pass to JSON.stringify. Because Firefox saves state objects to the user’s disk so they can be restored after the user restarts her browser,we impose a size limit of 640k characters on the JSON representation of a state object.