<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>sweetalert</title>
    
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/sweetalert/1.1.2/sweetalert.min.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/sweetalert/1.1.2/sweetalert.min.js"></script>
    
</head>
<body>
    <!-- 参考sweetalet中文版文档:http://mishengqiang.com/sweetalert/ -->
    <!-- 还有一个bootstrap风格的sweetalert插件 地址:http://lipis.github.io/bootstrap-sweetalert/-->
    <script type="text/javascript">

        swal({
            title: "你确定?",
            text: "您将无法恢复这个文件!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "是的,删除!",
            cancelButtonText: "不,取消",
            closeOnConfirm: false,
            closeOnCancel: false
        }, function(isConfirm) {
            if (isConfirm) {
                swal("删除!", "您的文件已被删除!", "success")                       
            } else{
                swal("取消!", "您的文件是安全的!", "error")
            }
        })
    </script>
</body>
</html>

 

相关文章:

  • 2021-05-29
  • 2021-12-24
  • 2022-12-23
  • 2021-12-02
  • 2022-02-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
相关资源
相似解决方案