Page is not waiting for response from SweetAlert confirmation window

前端 未结 4 2036
一生所求
一生所求 2021-02-20 11:27

I am trying to upgrade my JavaScript confirm() action to use SweetAlert. Currently my code is something like this:



        
4条回答
  •  自闭症患者
    2021-02-20 12:19

    $('.delete').click(function () {
    var id = this.id;
    swal({
      title: "Are you sure?",
      text: "Your will not be able to recover this post!",
      type: "warning",
      showCancelButton: true,
      confirmButtonColor: "#DD6B55",
      confirmButtonText: "Yes, delete it!",
      closeOnConfirm: false
    },
    function(){
       alert(id);
    });
    });
    
    
    
    

提交回复
热议问题