当我使用Ajax sweet Alert时不显示图像。我正在和laravel一起工作

时间:2018-06-01 08:45:04

标签: javascript php ajax laravel sweetalert

当我使用Ajax时,甜蜜警报不显示图像。我正在和laravel一起工作。

这是我的代码,如果我删除了ajax函数,或者我使用了其他网站的图像。

我真的不知道,我认为laravel需要从Ajax请求中进行某种认证。请帮帮我!

 $(document).ready(function() {

    $('.confirmation').click(function(e) {

        e.preventDefault(); // Prevent the href from redirecting directly
        var linkURL = $(this).attr("href");
        warnBeforeRedirect(linkURL);

        });

         function warnBeforeRedirect(linkURL) {
            swal({
                title: "Are you sure?",
                text: "Once deleted, you will not be able to recover this team!",
                icon: "warning",
                buttons: true,
                dangerMode: true,
              })
              .then((willDelete) => {
                if (willDelete) {
                    swal({
                        title: "Checking...",
                        text: "Please wait",
                        icon: icons,
                        button: false,
                        allowOutsideClick: false
                      });
                      $.ajax({
                        url: linkURL,
                        type: 'GET', 
                        success: function(result){
                        swal("The team was deleted!");
                    }
                });


                } else {
                  swal("The team was NOT deleted!");
                }
              });
          }

    });

0 个答案:

没有答案