Javascript 引导框和确认消息

Javascript 引导框和确认消息,javascript,bootbox,Javascript,Bootbox,我只使用基本确认消息,但没有显示消息 bootbox.confirm("Are you sure?", "No", "Yes", function(result) { alert("test"); }); 您可以使用: 在这里工作!:) $('表格')。提交(功能(e){ e、 预防默认值(); var form=此; bootbox.confirm(“确定要删除此项吗?”)函数(结果){ 如果(结果){ 表单提交(); } }); }); 这适用于asp.net核心 将整个表

我只使用基本确认消息,但没有显示消息

bootbox.confirm("Are you sure?", "No", "Yes", function(result) {
    alert("test");
  });

您可以使用:

在这里工作!:)


$('表格')。提交(功能(e){
e、 预防默认值();
var form=此;
bootbox.confirm(“确定要删除此项吗?”)函数(结果){
如果(结果){
表单提交();
}
});
});
这适用于
asp.net核心
将整个表单id命名为(表单)

bootbox.dialog({
    message:"Are you sure?",
    buttons: {
      yes: { //Button Yes
        label: "Yes",
        className: "btn-success",
        callback: function(result) { //Do whatever you want here
            alert("test");   
        }
      },
      no: { //Button No
         label: "No",
        className: "btn-danger",
        callback: function() {}
      }
    }
}); 
<script>
        $('#form').submit(function (e) {
            e.preventDefault();

            var form = this;
            bootbox.confirm("Are you sure you want to delete this?", function (result) {
                if (result) {
                    form.submit();
                }
            });
        });
</script>