Home  >  Q&A  >  body text

javascript - How to clear the history of the current page

For example, there are currently 10 historical records, that is

window.history.length; // 10

How to delete these historical records

我想大声告诉你我想大声告诉你2730 days ago637

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-19 10:21:00

    History is generally stored locally on the client, so js should not be able to clear it;
    You can only start with other ideas, depending on the needs of the subject.

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-19 10:21:00

    It doesn’t seem to work, you can try other methods to achieve the effect you want

    reply
    0
  • 怪我咯

    怪我咯2017-05-19 10:21:00

    window.history cannot be cleared

    reply
    0
  • Cancelreply