h5的插入历史记录和替换历史记录

history.replaceState(存储空间640k, 页面标题, 'url');

history,pushState(存储空间640k, 页面标题, 'url');

可实现无刷新页面

a页 


b页

<script>

history.replaceState(存储空间640k, 页面标题, 'a页');

</script>

b页地址直接被改为a页地址


c页 返回 返回至a页 再次返回 a页


页面标题暂无浏览器支持,通常设置为null


onpopstate 监听浏览器返回或前进触发函数,返回true或false

猜你喜欢

转载自blog.csdn.net/qq_16591861/article/details/77867822