我的表单有一个确认对话框。它在 jquery 提交函数中。我正在使用 alertify 来显示确认对话框。但问题是我的 jquery 提交函数在 alertify 获取确认框值之前返回。阅读 alertify 是非阻塞的。有什么办法可以克服这个问题并将确认框的值返回到我的表单中?
$("#viewform").submit(function(){
alertify.confirm("Delete the selected entry?",function(e){
if(e)
return true;
else
return false;
});
});
该函数始终返回 true。我想返回确认框的输出。如何返回确认框的延迟返回值?