网页倒退监听

 pushHistory();
window.addEventListener("popstate", function(e) {
//回调函数中实现需要的功能
// alert("我监听到了浏览器的返回按钮事件啦");
window.location.href = url; //在这里指定其返回的地址
}, false); function pushHistory()
{ var state = { title: "我的合同", url: "#" }; window.history.pushState(state, state.title, state.url); }



原文地址:https://www.cnblogs.com/sure2016/p/9475508.html