1
如何使用sweetalert进行没有确认按钮的Ajax调用,但仍显示加载gif?基本上我希望在Ajax调用运行时显示加载gif。开箱即用的解决方案要求您在Ajax调用之前启用确认按钮。Sweet Alert - 没有确认按钮的Ajax调用
下显然是行不通的:
window.swal({
title: "Checking...",
text: "Please wait",
imageUrl: "images/ajaxloader.gif",
showConfirmButton: false,
allowOutsideClick: false
},
function() {
$.getJSON('myurl').done(function (data) {
swal("", "Good job!", "success");
}).fail(function (jqXHR, textStatus, err) {
swal("", "An error occurred", "error");
});
});
https://limonte.github.io/sweetalert2/#ajax-request –