jquery sweet alert 添加详细信息按钮

jquery sweet alert add detail button

我需要用显示 'detail' 的按钮显示甜蜜的警报,通过单击此按钮,用户可以被重定向到另一个页面。我希望它保留 'error' 甜蜜警报的风格。可能吗?

swal({
  title: "Sorry but error occurred",
  text: "Sorry but error occurred",
  type: "error",
  allowEscapeKey: true
});

试试这个:检查 snnipet

sweetAlert({
            title: "Sorry but error occurred",
            text: "Sorry but error occurred",
            type: "error",
            allowEscapeKey: true,
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Detail",
            cancelButtonText: "Cancel",
            closeOnConfirm: false,
            closeOnCancel: true
            }, function (isConfirm) {
               if (isConfirm) {
                  window.location.href  ="www.yoururl.com/index.php";
               }
            });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css'>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>