Confirm gives you chance to click on cancel, and reload will not be done!
(确认使您有机会单击“取消”,并且不会重新加载!)
Instead, you can use something like this:
(相反,您可以使用如下所示的内容:)
if(alert('Alert For your User!')){}
else window.location.reload();
This will display alert to your user, and when he clicks OK, it will return false and reload will be done!
(这将向您的用户显示警报,当他单击“确定”时,它将返回false并完成重新加载!)
:) Also, the shorter version:(:)另外,较短的版本:)
if(!alert('Alert For your User!')){window.location.reload();}
I hope that this helped!?
(希望对您有所帮助!?)
:)(:))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…