📜  如何禁用返回 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:26.131000             🧑  作者: Mango

代码示例1
history.pushState(null, null, null);
$(window).on("popstate", function (event) {
  if (!event.originalEvent.state) {
    history.pushState(null, null, null);
    return;
  }
});