js
var count = 0 ; window.history.pushState(null, null, "#"); window.addEventListener("popstate", function(e) { window.history.pushState(null, null, "#"); document.getElementById(‘logView‘).innerHTML = "用户点击返回" + (++count) })
html
<p id="logView">test2</p>
原文:https://www.cnblogs.com/cnsdhzzl/p/9077442.html