title: How to show loading function before get data from server?
body: <p>I use Ajax and SweetAlert2 library to use alert UI. I search the how can I show the loading process during get data from server and I thought I can use beforeSend function. I write code like this.</p>
  
  <p>So I put the Loading Process code inside the beforeSend but I don't know why It's not working. So I want to check is it works in beforeSend code so I write console.log code inside it and it actually works. But I don't know why the Swal.showLoading(); code is not working.</p>
  
  <p>When I just type it in google console it works.</p>
  
  <p>Loading Code is Simple. </p>
  
  <pre><code>Swal.showLoading();
  </code></pre>
  
  <p>And I want When it finish it show Finish Code.</p>
  
  <pre><code>/* Mypage */
  function getData() {
      Swal.fire({
          title: 'Do you want to get data from Github?',
          text: "You won't be able to revert this!",
          type: 'warning',
          showCancelButton: true,
          allowOutsideClick: false,
          confirmButtonColor: '#3085d6',
          cancelButtonColor: '#d33',
          confirmButtonText: 'Yes, Get DATA!'
      }).then((result) =&gt; {
          if (result.value) {
              $.ajax({
                  type: "POST",
                  // contentType: "application/json",
                  url: `/${userId}/admin/getData`,
                  dataType: "json",
                  beforeSend: function () {
                      Swal.showLoading();
                      console.log('Loading');
                  },
                  success: function (redrawData) {
                      console.log(JSON.stringify(redrawData));
                      let existTable = $('#dataTable').DataTable();
                      existTable.destroy();
                      $('#dataTable').DataTable({
                          aaData: redrawData, // Returned Data from Server
                          aoColumns: [{
                                  mData: 'id',
                                  "render": function (value, type, row) {
                                      return `&lt;a href="/${userId}/${row.id}"&gt;${row.id}&lt;/a&gt;`;
                                  }
                              },
                              {
                                  mData: 'name'
                              },
                              {
                                  mData: 'type'
                              },
                              {
                                  mData: 'url'
                              },
                              {
                                  mData: 'imgurl',
                                  "render": function (value, type, row) {
                                      return `&lt;img src="${row.imgurl}"&gt;`;
                                  }
                              },
                              {
                                  mData: 'sumlang'
                              },
                              {
                                  mData: 'pjdate1'
                              },
                              {
                                  mData: 'pjdate2'
                              },
                              {
                                  mData: 'githuburl'
                              }
                          ]
                      })
                  },
                  complete: function () {
                      Swal.fire(
                          'Get!',
                          'Your file has been deleted.',
                          'success'
                      )
                  },
                  error: function (e) {
                      Swal.fire(
                          'Failed to save',
                          'If this message is output continuously, please contact to administrator.',
                          'error'
                      )
                  }
              });
          }
      })
  }
  </code></pre>