如果按下警告,请在确定按钮后转到URL [英] Go to URL after OK button if alert is pressed
本文介绍了如果按下警告,请在确定按钮后转到URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要确保当用户在JavaScript警报窗口中单击确定时,浏览器会移动到其他URL。这可能吗?
I need to make sure that when the user clicks OK in a JavaScript alert window, the browser moves to a different URL. Is this possible?
推荐答案
我怀疑你的意思是 确认
窗口(即是/否选项)。
I suspect you mean in a confirm
window (ie. Yes/No options).
if (window.confirm('Really go to another page?'))
{
// They clicked Yes
}
else
{
// They clicked no
}
这篇关于如果按下警告,请在确定按钮后转到URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文