Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
52
rated 0 times [  53] [ 1]  / answers: 1 / hits: 27034  / 7 Years ago, fri, september 22, 2017, 12:00:00

How do I style AJAX respond data in SweetAlert below is my code and sample image any help will be duly appreciated. Order screenshot



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);
});
});

More From » jquery

 Answers
17

Try this using SweetAlert2,



.done(function (data) {
swal({
title: 'Thank you for your order',
type: 'success',
html: data
});
});


Note: The SweetAlert repo seems to be unmaintained. Give a try to Sweetalert2. It is same as that of Sweetalert but with HTML support in modal and some other options for customization modal window - width, padding, Esc button behavior, etc.


[#56416] Tuesday, September 19, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aleenamarinr

Total Points: 610
Total Questions: 109
Total Answers: 118

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
;