Il mio metodo Ajax si presenta cosìCome aggiungere Ajax chiamata con dolce avviso
$.post(url,{
ajax_call:"putDonation",
addresse:addresse,
phone:phone,
email:email,
name:name,
amount:amount,
amountinwords:amountinwords
}).done(function(data){
console.log(data);
var arr = [];
try {
var str = "";
//convert to json string
arr = $.parseJSON(data); //convert to javascript array
$.each(arr,function(key,value){
str +="<li>"+value+"</li>";
});
alert(str);
$(".alert-danger").show();
$("#error").html(str);
} catch (e) {
swal("Jay Gayatri !", 'Donation Sucessful', "success")
$("#donation")[0].reset();
}
})
voglio mostrare un qualcosa di dolce avvertimento di allarme a comparsa come questo
swal({
title: "Are you sure ?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
},
function(){
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
E se si fa clic sul annullare non dovrebbe fare la chiamata Ajax, Se si seleziona Sì, solo la chiamata dovrebbe accadere
Così qualcuno può dirmi come posso incorporare il metodo Ajax nei metodi Sweet Alert
Grazie