title: How to make AJAX call using SweetAlert
body: <p>Am using <code>SweetAlert</code> to do an AJAX call when user want to delete an account.But isn't working below is my code. I want to also add confirm and cancel button but I don't know how to use <code>SweetAlert</code> very well. </p>
  
  <p>Any help will be appreciated.</p>
  
  <p>I'm using <strong>CDN</strong> of <code>SweetAlert</code>.</p>
  
  <p><a href="https://unpkg.com/sweetalert/dist/sweetalert.min.js" rel="nofollow noreferrer">https://unpkg.com/sweetalert/dist/sweetalert.min.js</a> from <a href="https://sweetalert.js.org/" rel="nofollow noreferrer">https://sweetalert.js.org/</a></p>
  
  <pre><code> swal({
     closeOnClickOutside: false,
     icon: "warning",
     title: 'Do you want to remove your account?',
     text: 'This action can not be undo',
     showConfirmButton: false,
     closeOnConfirm: false,
     showSpinner: true
   },function () {
     $.ajax({
       url: "delete_account.php",
       method: "POST",
       data: {
         id: 5
       },
       success: function () {
         swal("Deleted!", "Successfully deleted", "success");
       }
     });
   });
  </code></pre>