当前位置: 代码迷 >> 综合 >> 浏览器后退跳转到指定的页面
  详细解决方案

浏览器后退跳转到指定的页面

热度:50   发布时间:2023-10-20 04:51:53.0
pushHistory();//监听浏览器后退事件window.addEventListener("popstate",function(e) {//转向指定的URLlocation.href='/footer.html?home=2';}, false);//清空浏览器历史记录function pushHistory() {var url = "#";var state = {title: "title",url: "#"};window.history.pushState(state, "title", "#");}
  相关解决方案