如何通过js启用/禁用浏览器历史记录 [英] How to Enable/Disable browser history through js

查看:343
本文介绍了如何通过js启用/禁用浏览器历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以通过Java脚本代码启用或禁用浏览器历史吗?
如果可能的话,请告诉我执行此操作的机制。

can we enable or disable browser history through java script code ?? If possible please tell me the mechanism to do this .

推荐答案

我认为这是不可能的。

I think it is not possible.

可以尝试使用 document.location.replace()来清除历史记录中的最后一个条目吗?并将其替换为新网址的地址。

Can you try using document.location.replace() it is used to clear the last entry in the history and replace it with the address of a new url.

这篇关于如何通过js启用/禁用浏览器历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆