gpt4 book ai didi

javascript - window.location 不会使用参数重新加载

转载 作者:行者123 更新时间:2023-12-03 02:39:35 25 4
gpt4 key购买 nike

我在这里用参数替换 window.location :

 window.location.replace('/results/#'+ params);

但这不会使用新参数重新加载页面,我还尝试在以下时间后重新加载页面:

 window.location.pathname === '/results/' && window.location.reload();

但这会使用旧参数重新加载页面

最佳答案

# 哈希不会导致页面重新加载,因为它代表当前页面的片段。您可以监听 onhashchange 并在那时执行一些操作。

关于javascript - window.location 不会使用参数重新加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48389322/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com