gpt4 book ai didi

Javascript document.location.reload 不起作用

转载 作者:行者123 更新时间:2023-12-02 18:00:41 31 4
gpt4 key购买 nike

当我像下面的情况 1 一样使用 document.location.reload() 时,它不起作用。但是当我像 case2 一样添加 alert() 时,它就起作用了。我想知道发生了什么?

//case1: does not work
document.location='rc_msg.php?remove=0';
document.location.reload();
//case2: work
document.location='rc_msg.php?remove=0';
document.location.reload();
alert("OK!!");
<小时/>

我没有注意到我输入了两次“=”,对此我感到很抱歉。我已经尝试过下面的意见解决方案,但它们都不起作用

最佳答案

您要测试该位置(双等号)还是为其分配新位置(单等号)?

尝试:

document.location='rc_msg.php?remove=0';
document.location.reload();

关于Javascript document.location.reload 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20558802/

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