1.引入

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"> </script> 

2.三个常用的提示框

$(".demo_1").click(function() { 
    swal("这是一个信息提示框!"); 
}); 
$(".demo_2").click(function() { 
    swal("Good!", "弹出了一个操作成功的提示框", "success"); 
}); 
$(".demo_3").click(function() { 
    swal("OMG!", "弹出了一个错误提示框", "error"); 
});

3.警告框提示

swal({ 
    title: "您确定要删除吗?", 
    text: "您确定要删除这条数据?", 
    type: "warning", 
    showCancelButton: true, 
    closeOnConfirm: false, 
    confirmButtonText: "是的,我要删除", 
    confirmButtonColor: "#ec6c62" 
}, function() { 
    $.post(getUrl("Cart/del"), {id: id}, function(data) { 
        location.reload(); 
    }) 
});

 

 

相关文章:

  • 2021-05-26
  • 2022-12-23
  • 2022-03-10
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2022-01-22
  • 2022-03-08
  • 2021-11-07
相关资源
相似解决方案