gpt4 book ai didi

javascript - 更改 url 而不重新加载页面

转载 作者:行者123 更新时间:2023-12-03 11:26:29 25 4
gpt4 key购买 nike

如何从这种类型的网址传递:

http://domain.com

对于这种类型:

http://domain.com/#0123456789

无需重新加载页面。

我不想使用 HTML5 window.history.replaceState 函数,因为它不适用于旧版本的 Internet Explorer。

最佳答案

我找到了答案:

location.hash = "0123456789";

很抱歉回答我自己的问题...但没有一个答案给出了正确的观点。

关于javascript - 更改 url 而不重新加载页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26899350/

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