当我在下面的case1中使用document.location.reload()
时,它不起作用。但是当我在case2中添加一个alert()
时,它可以工作。我想弄清楚发生了什么?Javascript document.location.reload does not work
//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'是一个对象,你试图将它与一个字符串进行比较... –
你的代码没有意义......你想要做什么?写下你真实的代码。 – epascarello