移動端瀏覽器監聽返回鍵

jshtml

var count = 0 ;
window.history.pushState(null, null, "#");
window.addEventListener("popstate", function(e) {
window.history.pushState(null, null, "#");
  document.getElementById('logView').innerHTML = "用戶點擊返回" + (++count)
})

htmlspa

<p id="logView">test2</p>
相關文章
相關標籤/搜索