history的使用

 pushState和replaceState

参考:http://www.zhangxinxu.com/wordpress/2013/06/html5-history-api-pushstate-replacestate-ajax/

1.history.pushState({},"","xxx.html");

2.history.replaceState(null,"","xxx.html");

3.window.addEventListener("popstate",function(){

  var currentState = history.state;

  /*
     * 该干嘛干嘛
    */	

})

原文地址:https://www.cnblogs.com/QIQIZAIXIAN/p/6944848.html