I have a requirement to display a popup message (similiarly to the outcome of the "confirm" function of Alertify.js), and to unconditionally refresh the screen after the popup is being closed by the user, whether it is done through the 'X' or the 'OK' button.
(我需要显示一个弹出消息(类似于Alertify.js的“确认”功能的结果),并且在用户关闭弹出窗口后是否无条件刷新屏幕,无论是否通过'X完成”或“确定”按钮。)
Basically, the "confirm" function proposed by Alertify.js adheres to my need except its "Cancel" button (as it does nothing after the user clicks on it).
(基本上,Alertify.js提出的“确认”功能除了它的“取消”按钮外一直符合我的需要(因为在用户单击该按钮后它什么也不做)。)
If I could get rid of the cancel button somehow that would be great, but I'm not sure how to or if I'm even able to at all.(如果我能以某种方式摆脱取消按钮,那将是很好的选择,但是我不确定如何或者我什至无法做到。)
What work-around would you suggest to that matter?(您对此有何建议?)
I tried this code,
(我尝试了这段代码,)
alert("Successful Message");
location.reload();
This code causes the screen to refresh but doesn't show the alert.
(此代码导致屏幕刷新,但不显示警报。)
I guess the second line doesn't wait for the alert message to be closed and just immediately reloads the screen.(我猜第二行不会等待警报消息关闭,而只是立即重新加载屏幕。)
Thanks in advance!
(提前致谢!)
ask by Adi hahanov translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…