history的使用

mac2022-06-30  93

 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

最新回复(0)