扫码关注官方订阅号
比如我现在在C页面,点浏览器后退是退回到B页面,我现在想直接从C页面后退到A页面,这个该怎么实现?
走同样的路,发现不同的人生
在从 b 到 c 的时候用 window.location.replace(url) 代替 window.location.href = url。如果原来是直接的 <a href="xxx">xxxxxxx</a>,就改成 href=javascript:window.location.replace("xxx");
window.location.replace(url)
window.location.href = url
<a href="xxx">xxxxxxx</a>
href=javascript:window.location.replace("xxx");
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
在从 b 到 c 的时候用
window.location.replace(url)
代替window.location.href = url
。如果原来是直接的<a href="xxx">xxxxxxx</a>
,就改成href=javascript:window.location.replace("xxx");