-1
如何在ajax調用期間顯示加載圖標或旋轉。以下是我的代碼如何在sweetalert上顯示加載圖標
swal({
title: "Confirm your transaction",
html:true,
showSpinner: true,
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Send",
closeOnConfirm: false
},function() {
$.ajax({
type: "post",
url: remoteUrl,
data: largeParams,
success: function (data) { }
}).done(function (data) {
swal("Thank you for your order", data, "success");
}).error(function (data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
});
將不勝感激。
我從來沒有使用SweetAlert,但檢查網頁(https://sweetalert.js.org)我找不到所有這些方法:HTML,showSpinner,showCancelButton,confirmButtonColor,confirmButtonText,closeOnConfirm ...你是否使用這個插件還是有另一個? –
使用承諾'https:// sweetalert.js.org/guides /#using-promises' – tonoslfx